diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index 431770b65..e1ec6443b 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -472,12 +472,12 @@ func GetManageStatisticsJob(db *DaoDB, cityCodes []int, fromTime, toTime time.Ti sql := ` SELECT t1.count acceptCount, t2.count finish_count, t3.count cancel_count, a.browse_count, a.title, a.browse_count / t2.count inversion_rate, t4.total_cash FROM job a - JOIN (SELECT job_id, COUNT(*) count FROM job_order WHERE status = ? GROUP BY 1) t1 ON t1.job_id = a.id - JOIN (SELECT job_id, COUNT(*) count FROM job_order WHERE status = ? GROUP BY 1) t2 ON t2.job_id = a.id - JOIN (SELECT job_id, COUNT(*) count FROM job_order WHERE status = ? GROUP BY 1) t3 ON t3.job_id = a.id + LEFT JOIN (SELECT job_id, COUNT(*) count FROM job_order WHERE status = ? GROUP BY 1) t1 ON t1.job_id = a.id + LEFT JOIN (SELECT job_id, COUNT(*) count FROM job_order WHERE status = ? GROUP BY 1) t2 ON t2.job_id = a.id + LEFT JOIN (SELECT job_id, COUNT(*) count FROM job_order WHERE status = ? GROUP BY 1) t3 ON t3.job_id = a.id ` sql += ` - JOIN (SELECT COUNT(b.id) * a.avg_price total_cash, a.id + LEFT JOIN (SELECT COUNT(b.id) * a.avg_price total_cash, a.id FROM job a JOIN job_order b ON a.id = b.job_id AND b.status = ? GROUP BY 2) t4 ON t4.id = a.id