Commit 6234912f by 朱继来

调整释放脚本

parent 3a3166f7
Showing with 14 additions and 14 deletions
...@@ -42,10 +42,10 @@ func UpdateLimitFollowTime() { ...@@ -42,10 +42,10 @@ func UpdateLimitFollowTime() {
var sales model.Salesman var sales model.Salesman
err = row.StructScan(&sales) err = row.StructScan(&sales)
// 2-1、检查是否为线销售 // 2-1、检查是否为线销售
is_offline_sales := IsOfflineSales(sales.Sale_Id) is_online_sales := IsOnlineSales(sales.Sale_Id)
if is_offline_sales { // 属于线下销售,则跳出本次循环 if !is_online_sales { // 若不属于线上销售,则跳出本次循环
dao.GetDb().Exec("update lie_salesman set sys_limit = ? where user_id = ?", -1, sales.User_Id) dao.GetDb().Exec("update lie_salesman set sys_limit = ? where user_id = ?", -1, sales.User_Id)
continue continue
} }
...@@ -67,8 +67,8 @@ func UpdateLimitFollowTime() { ...@@ -67,8 +67,8 @@ func UpdateLimitFollowTime() {
} }
} }
// 检查是否属于线销售 // 检查是否属于线销售
func IsOfflineSales(sale_id int) bool { func IsOnlineSales(sale_id int) bool {
var user_info UserInfo var user_info UserInfo
err := dao.GetCmsDb().Get(&user_info, "select userId,department_id,position_id from user_info where userId = ?", sale_id) err := dao.GetCmsDb().Get(&user_info, "select userId,department_id,position_id from user_info where userId = ?", sale_id)
...@@ -77,9 +77,9 @@ func IsOfflineSales(sale_id int) bool { ...@@ -77,9 +77,9 @@ func IsOfflineSales(sale_id int) bool {
return false return false
} }
offline_sales_department_ids := GetOfflineSaleDepartment() online_sales_department_ids := GetOnlineSaleDepartment()
_, ok := SliceFind(offline_sales_department_ids, user_info.DepartmentId) _, ok := SliceFind(online_sales_department_ids, user_info.DepartmentId)
return ok return ok
} }
...@@ -94,19 +94,19 @@ func SliceFind(slice []int, val int) (int, bool) { ...@@ -94,19 +94,19 @@ func SliceFind(slice []int, val int) (int, bool) {
return -1, false return -1, false
} }
// 获取线下销售所有部门 (线下销售部 40) // 获取线上销售所有部门 (线上销售部 33)
func GetOfflineSaleDepartment() []int { func GetOnlineSaleDepartment() []int {
var offline_sales_department_ids []int var online_sales_department_ids []int
offline_sales_department_ids = append(offline_sales_department_ids, 40) online_sales_department_ids = append(online_sales_department_ids, 33)
var user_department []*UserDepartment var user_department []*UserDepartment
dao.GetCmsDb().Select(&user_department, "select department_id,department_name,parent_id from user_department where parent_id = 40") dao.GetCmsDb().Select(&user_department, "select department_id,department_name,parent_id from user_department where parent_id = 33")
for _, v := range user_department { for _, v := range user_department {
offline_sales_department_ids = append(offline_sales_department_ids, v.DepartmentId) online_sales_department_ids = append(online_sales_department_ids, v.DepartmentId)
} }
return offline_sales_department_ids return online_sales_department_ids
} }
// 计算跟进时间 // 计算跟进时间
......
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