This commit is contained in:
suyl
2021-06-03 18:19:18 +08:00
parent 320aae9b18
commit 0043d5abc6
3 changed files with 20 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ type PriceReferSnapshotExt struct {
}
//查询统计订单信息
func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate time.Time, toDate time.Time) (statisticsReportForOrdersList []*StatisticsReportForOrdersList, err error) {
func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate time.Time, toDate time.Time, marketPhone, jdPhone, mtPhone, ebaiPhone string) (statisticsReportForOrdersList []*StatisticsReportForOrdersList, err error) {
sql := `
SELECT
c.id store_id,
@@ -136,6 +136,22 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs, vendorIDs []int, fromDate
sql += ` WHERE c.id IN (` + GenQuestionMarks(len(storeIDs)) + `)`
sqlParams = append(sqlParams, storeIDs)
}
if marketPhone != "" {
sql += ` WHERE c.market_man_phone = ?`
sqlParams = append(sqlParams, marketPhone)
}
if jdPhone != "" {
sql += ` WHERE c.operator_phone = ?`
sqlParams = append(sqlParams, marketPhone)
}
if mtPhone != "" {
sql += ` WHERE c.operator_phone2 = ?`
sqlParams = append(sqlParams, marketPhone)
}
if ebaiPhone != "" {
sql += ` WHERE c.operator_phone3 = ?`
sqlParams = append(sqlParams, marketPhone)
}
if err = GetRows(db, &statisticsReportForOrdersList, sql, sqlParams...); err == nil {
return statisticsReportForOrdersList, nil
}