- 不用GROUP BY重新实现GetStores

This commit is contained in:
gazebo
2019-09-23 16:47:10 +08:00
parent 76e42e7043
commit 9ea9e484a7
5 changed files with 125 additions and 160 deletions

View File

@@ -199,15 +199,18 @@ func GetStoreDetail2(db *DaoDB, storeID int, vendorStoreID string, vendorID int)
return storeDetail, err
}
func GetStoreCourierList(db *DaoDB, storeID, status int) (courierStoreList []*model.StoreCourierMap, err error) {
func GetStoreCourierList(db *DaoDB, storeIDs []int, status int) (courierStoreList []*model.StoreCourierMap, err error) {
sql := `
SELECT t1.*
FROM store_courier_map t1
WHERE t1.deleted_at = ? AND t1.store_id = ?
WHERE t1.deleted_at = ?
`
sqlParams := []interface{}{
utils.DefaultTimeValue,
storeID,
}
if len(storeIDs) > 0 {
sql += " AND t1.store_id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
}
if status != model.StoreStatusAll {
sql += " AND t1.status = ?"