|
@@ -213,18 +213,18 @@ func (this *Customer) GetDeptCustomerList(ent_id, dept_id int, name, alloc, area
|
|
customerList = Mysql.SelectBySql(`SELECT GROUP_CONCAT(c.name) as staff_names,a.ordertime,a.name as customer_name,a.id as customer_id,a.updatetime from
|
|
customerList = Mysql.SelectBySql(`SELECT GROUP_CONCAT(c.name) as staff_names,a.ordertime,a.name as customer_name,a.id as customer_id,a.updatetime from
|
|
(select a.name,a.id,a.updatetime as ordertime,a.updatetime FROM entniche_customer a
|
|
(select a.name,a.id,a.updatetime as ordertime,a.updatetime FROM entniche_customer a
|
|
LEFT JOIN entniche_department_parent b on (a.dept_id=b.id)
|
|
LEFT JOIN entniche_department_parent b on (a.dept_id=b.id)
|
|
- WHERE `+searchSql+` order by updatetime desc limit ?,?) as a
|
|
|
|
|
|
+ WHERE `+searchSql+` order by updatetime desc) as a
|
|
LEFT JOIN entniche_user_customer b on (a.id=b.customer_id)
|
|
LEFT JOIN entniche_user_customer b on (a.id=b.customer_id)
|
|
LEFT JOIN entniche_user c on (b.user_id=c.id)
|
|
LEFT JOIN entniche_user c on (b.user_id=c.id)
|
|
- GROUP BY a.id `+allocSql+` order by updatetime desc`, searchValues...)
|
|
|
|
|
|
+ GROUP BY a.id `+allocSql+` order by updatetime desc limit ?,?`, searchValues...)
|
|
} else {
|
|
} else {
|
|
customerList = Mysql.SelectBySql(`SELECT GROUP_CONCAT(c.name) as staff_names,a.ordertime,a.name as customer_name,a.id as customer_id,a.updatetime from
|
|
customerList = Mysql.SelectBySql(`SELECT GROUP_CONCAT(c.name) as staff_names,a.ordertime,a.name as customer_name,a.id as customer_id,a.updatetime from
|
|
(select a.name,a.id,a.updatetime as ordertime,a.updatetime FROM entniche_customer a
|
|
(select a.name,a.id,a.updatetime as ordertime,a.updatetime FROM entniche_customer a
|
|
LEFT JOIN entniche_department_parent b on (a.dept_id=b.id)
|
|
LEFT JOIN entniche_department_parent b on (a.dept_id=b.id)
|
|
- WHERE `+searchSql+` order by updatetime desc) as a
|
|
|
|
|
|
+ WHERE `+searchSql+` order by updatetime desc limit ?,?) as a
|
|
LEFT JOIN entniche_user_customer b on (a.id=b.customer_id)
|
|
LEFT JOIN entniche_user_customer b on (a.id=b.customer_id)
|
|
LEFT JOIN entniche_user c on (b.user_id=c.id)
|
|
LEFT JOIN entniche_user c on (b.user_id=c.id)
|
|
- GROUP BY a.id order by updatetime desc limit ?,?`, searchValues...)
|
|
|
|
|
|
+ GROUP BY a.id order by updatetime desc`, searchValues...)
|
|
}
|
|
}
|
|
return
|
|
return
|
|
}
|
|
}
|