Commit 4dea815d by Joneq

晚上释放用户

parent 265a50be
...@@ -14,7 +14,7 @@ func NoCreateHandle() { ...@@ -14,7 +14,7 @@ func NoCreateHandle() {
db := dao.GetDb() db := dao.GetDb()
var assign_active model.AssignActive var assign_active model.AssignActive
var NoOrderHandleUser = make(map[int]int) var NoOrderHandleUser = make(map[int]int)
var month_time = (time.Now().Unix()- 86400 * 30 * 1) var month_time = (time.Now().Unix()- 86400 * 30)
//查找第一次出不再跟随的用户ID,然后释放 //查找第一次出不再跟随的用户ID,然后释放
rows,err := db.Queryx("select aa.user_id,turn_in_id,no_create_order from lie_assign_active as aa left join lie_user_extend ue on aa.user_id = ue.user_id where is_success = ? and ue.no_create_order = 1 and change_time < ? and latest_order_time < ?",1,month_time,month_time) rows,err := db.Queryx("select aa.user_id,turn_in_id,no_create_order from lie_assign_active as aa left join lie_user_extend ue on aa.user_id = ue.user_id where is_success = ? and ue.no_create_order = 1 and change_time < ? and latest_order_time < ?",1,month_time,month_time)
...@@ -23,6 +23,7 @@ func NoCreateHandle() { ...@@ -23,6 +23,7 @@ func NoCreateHandle() {
err = rows.StructScan(&assign_active) err = rows.StructScan(&assign_active)
service.AdminErr(err) service.AdminErr(err)
NoOrderHandleUser[assign_active.User_Id] = assign_active.Turn_In_id NoOrderHandleUser[assign_active.User_Id] = assign_active.Turn_In_id
dao.GetDb().Exec("delete from lie_salesman where user_id = ?",assign_active.User_Id)
} }
//查找第二次出不再跟随的用户ID,释放并且屏蔽 //查找第二次出不再跟随的用户ID,释放并且屏蔽
......
...@@ -15,7 +15,7 @@ func Notify() { ...@@ -15,7 +15,7 @@ func Notify() {
//查找出需要发送通知的用户,发送通知 //查找出需要发送通知的用户,发送通知
rows,err := dao.GetDb().Queryx("select turn_in_id,aa.user_id from lie_assign_active as aa left join lie_user_extend ue on aa.user_id = ue.user_id where (ue.no_create_order = 1 and change_time < ? and change_time > ? and latest_order_time < ? ) or (ue.no_create_order = 2 and change_time < ? and change_time > ? and latest_order_time < ? ) ", rows,err := dao.GetDb().Queryx("select turn_in_id,aa.user_id from lie_assign_active as aa left join lie_user_extend ue on aa.user_id = ue.user_id where (ue.no_create_order = 1 and change_time < ? and change_time > ? and latest_order_time < ? ) or (ue.no_create_order = 2 and change_time < ? and change_time > ? and latest_order_time < ? ) ",
(time.Now().Unix()- 86400 * 23),(time.Now().Unix()- 86400 * 24),(time.Now().Unix()- 86400 * 23),(time.Now().Unix()- 86400 * 103),(time.Now().Unix()- 86400 * 104),(time.Now().Unix()- 86400 * 103)) (time.Now().Unix()- 86400 * 23),(time.Now().Unix()- 86400 * 24),(time.Now().Unix()- 86400 * 23),(time.Now().Unix()- 86400 * 113),(time.Now().Unix()- 86400 * 114),(time.Now().Unix()- 86400 * 113))
service.AdminErr(err) service.AdminErr(err)
var user_info model.UserInfo var user_info model.UserInfo
...@@ -34,7 +34,7 @@ func Notify() { ...@@ -34,7 +34,7 @@ func Notify() {
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
} }
service.SendMessage(user_info.Mobile,"您的客户:"+user_company.Com_name+"在跟进后23天任未下单,还有7天将被转出,请注意查看") service.SendMessage(user_info.Mobile,"您的客户:"+user_company.Com_name+"在跟进后多天后仍未下单,还有7天将被转出,请注意查看")
} }
} }
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