This commit is contained in:
苏尹岚
2020-11-10 10:41:57 +08:00
parent 1aaeab99cc
commit 1ddd2d7362

View File

@@ -67,7 +67,7 @@ func GetUsers(db *DaoDB, userType int, keyword string, userIDs, userID2s, mobile
sqlParams := []interface{}{}
sql := `
SELECT SQL_CALC_FOUND_ROWS
t1.*, IF(t2.accept_order_count is NULL, 0, t2.accept_order_count), IF(t3.finished_order_count is NULL, 0, t3.finished_order_count)
t1.*, IF(t2.accept_order_count is NULL, 0, t2.accept_order_count) accept_order_count, IF(t3.finished_order_count is NULL, 0, t3.finished_order_count) finished_order_count
FROM user t1
LEFT JOIN (SELECT user_id, COUNT(user_id) accept_order_count FROM job_order`
if len(userIDs) > 0 {