统计订单查询bug修改

This commit is contained in:
苏尹岚
2019-11-25 17:02:35 +08:00
parent 228071d00e
commit 0f582721f2

View File

@@ -88,7 +88,7 @@ func GetStatisticsReportForOrders(db *DaoDB, storeIDs []int, fromDate time.Time,
sqlParams = append(sqlParams, fromDate, toDate)
}
if len(storeIDs) > 0 {
sql += ` AND a.store_id IN(` + GenQuestionMarks(len(storeIDs)) + `)`
sql += ` AND IF(a.jx_store_id != 0, a.jx_store_id, a.store_id) IN(` + GenQuestionMarks(len(storeIDs)) + `)`
sqlParams = append(sqlParams, storeIDs)
}
sql += `
@@ -160,7 +160,7 @@ func GetGetStatisticsReportForAfsOrders(db *DaoDB, storeIDs []int, fromDate time
sqlParams = append(sqlParams, fromDate, toDate)
}
if len(storeIDs) > 0 {
sql += ` AND a.store_id IN(` + GenQuestionMarks(len(storeIDs)) + `)`
sql += ` AND IF(a.jx_store_id != 0, a.jx_store_id, a.store_id) IN(` + GenQuestionMarks(len(storeIDs)) + `)`
sqlParams = append(sqlParams, storeIDs)
}
sql += `