This commit is contained in:
suyl
2021-06-04 10:14:15 +08:00
parent 0043d5abc6
commit 621a40e399

View File

@@ -131,26 +131,27 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate
GROUP BY 1
)ss ) s
ON s.store_id = c.id
WHERE 1 = 1
`
if len(storeIDs) > 0 {
sql += ` WHERE c.id IN (` + GenQuestionMarks(len(storeIDs)) + `)`
sql += ` AND c.id IN (` + GenQuestionMarks(len(storeIDs)) + `)`
sqlParams = append(sqlParams, storeIDs)
}
if marketPhone != "" {
sql += ` WHERE c.market_man_phone = ?`
sql += ` AND c.market_man_phone = ?`
sqlParams = append(sqlParams, marketPhone)
}
if jdPhone != "" {
sql += ` WHERE c.operator_phone = ?`
sqlParams = append(sqlParams, marketPhone)
sql += ` AND c.operator_phone = ?`
sqlParams = append(sqlParams, jdPhone)
}
if mtPhone != "" {
sql += ` WHERE c.operator_phone2 = ?`
sqlParams = append(sqlParams, marketPhone)
sql += ` AND c.operator_phone2 = ?`
sqlParams = append(sqlParams, mtPhone)
}
if ebaiPhone != "" {
sql += ` WHERE c.operator_phone3 = ?`
sqlParams = append(sqlParams, marketPhone)
sql += ` AND c.operator_phone3 = ?`
sqlParams = append(sqlParams, ebaiPhone)
}
if err = GetRows(db, &statisticsReportForOrdersList, sql, sqlParams...); err == nil {
return statisticsReportForOrdersList, nil