row,err:=dao.GetDb().Queryx("select * from lie_feedback where type = ? and is_add_task = ? order by id desc limit 100",7,0)
iferr!=nil{
logger.Info("获取快速找料用户失败: ",err.Error())
return
}
forrow.Next(){
varfeedbackmodel.Feedback
row.StructScan(&feedback)
// 判断该用户是否存在注册领取任务记录或快速找料任务,若存在则跳过
vartask_infomodel.TaskInfo
dao.GetDb().Get(&task_info,"select * from lie_task_info where user_id = ? and status = ? and (task_type = ? or task_type = ?) limit 1",feedback.User_Id,1,1,4)
iftask_info.Id!=0{
continue
}
current_time:=time.Now().Unix()// 当前时间
// 查看用户是否分配
varsalesmanmodel.Salesman
dao.GetDb().Get(&salesman,"select * from lie_salesman where user_id = ?",feedback.User_Id)
dao.GetDb().Exec("insert into lie_task_info (user_id, task_id, task_type, task_display_degree, sale_id, create_time, update_time) value (?, ?, ?, ?, "+