This commit is contained in:
苏尹岚
2021-01-22 10:05:43 +08:00
parent f85fa9e12a
commit 519592bc31
14 changed files with 145 additions and 30 deletions

View File

@@ -514,7 +514,7 @@ func GetOpenedStoreCouriersByStoreID(db *DaoDB, storeID, vendorID int) (storeMap
return storeMaps, nil
}
func GetStoreList(db *DaoDB, idList, cityCodes, statuss []int, mobileList []string, shortRoleName string) (storeList []*model.Store, err error) {
func GetStoreList(db *DaoDB, idList, cityCodes, statuss, brandIDs []int, mobileList []string, shortRoleName string) (storeList []*model.Store, err error) {
sql := `
SELECT t1.*
FROM store t1
@@ -534,6 +534,10 @@ func GetStoreList(db *DaoDB, idList, cityCodes, statuss []int, mobileList []stri
sql += " AND t1.status IN (" + GenQuestionMarks(len(statuss)) + ")"
sqlParams = append(sqlParams, statuss)
}
if len(brandIDs) > 0 {
sql += " AND t1.brand_id IN (" + GenQuestionMarks(len(brandIDs)) + ")"
sqlParams = append(sqlParams, brandIDs)
}
if len(mobileList) > 0 {
sql += " AND (t1.tel1 IN (" + GenQuestionMarks(len(mobileList)) + ") OR t1.tel2 IN (" + GenQuestionMarks(len(mobileList)) + "))"
sqlParams = append(sqlParams, mobileList, mobileList)