diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index 09f903bdd..fb159f7c4 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -298,9 +298,6 @@ func GetPayStatistics(db *DaoDB, userID string, pop int, cityCodes []int, mobile if pop == 1 { sql2 += " JOIN user e ON e.moblie = ? AND a.pop_user = e.user_id" sqlParams2 = append(sqlParams2, mobile) - } else { - sql2 += " AND a.mobile = ?" - sqlParams2 = append(sqlParams2, mobile) } } sql2 += ` @@ -324,6 +321,12 @@ func GetPayStatistics(db *DaoDB, userID string, pop int, cityCodes []int, mobile sql2 += ` AND a.city_code IN (` + GenQuestionMarks(len(cityCodes)) + `)` sqlParams2 = append(sqlParams2, cityCodes) } + if mobile != "" { + if pop == 0 { + sql2 += " AND a.mobile = ?" + sqlParams2 = append(sqlParams2, mobile) + } + } if userID != "" { if pop == 1 { sql2 += " AND a.pop_user = ?"