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