Commit b3af516f by 朱继来

快速找料添加老客户判断

parent 545a2041
Showing with 12 additions and 0 deletions
......@@ -5,6 +5,8 @@ package main
1. 当存在注册任务时,不生成快速找料任务
2. 任务未结束前,此任务唯一,不重复生成
3. 不设置截止时间
额外新增条件:只有老客户执行快速找料才会触发快速找料任务(老客户定义:非当天注册的客户) ---20201010
*/
import (
"crm-server/cmd/task/common"
......@@ -82,6 +84,16 @@ func setFindGoods(status, task_id, task_type, task_display_degree int) {
var feedback model.Feedback
row.StructScan(&feedback)
// 判断该用户是否为老客户(非当天注册)
var t = time.Now()
var zero_time = time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location()).Unix()
var user model.Users
db.Get(&user, "select user_id from lie_user where user_id = ? and copy_ctime < ?", feedback.Outter_Uid, zero_time)
if user.User_id == 0 { // 注册时间大于等于当天零点,则跳出
continue
}
// 判断该用户是否存在注册领取任务记录或快速找料任务,若存在则跳过
var task_info model.TaskInfo
db.Get(&task_info, "select * from lie_task_info where user_id = ? and status = ? and (task_type = ? or task_type = ?) limit 1", feedback.Outter_Uid, 1, 1, 4)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment