+ Store添加MarketManRole与OperatorRole
- GetStoreListByMobileOrStoreIDs支持按Store.MarketManRole与OperatorRole来得到门店列表
This commit is contained in:
@@ -154,7 +154,7 @@ func GetStoreListByMobile(db *DaoDB, mobile string) (storeList []*StoreWithCityN
|
||||
return storeList, err
|
||||
}
|
||||
|
||||
func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, storeIDs []int) (storeList []*StoreWithCityName, err error) {
|
||||
func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, shortRoleNameList []string, storeIDs []int) (storeList []*StoreWithCityName, err error) {
|
||||
sql := `
|
||||
SELECT t1.*, t2.name city_name
|
||||
FROM store t1
|
||||
@@ -167,6 +167,10 @@ func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, storeIDs []int) (s
|
||||
sql += " OR t1.market_man_phone = ? OR t1.operator_phone = ?"
|
||||
sqlParams = append(sqlParams, mobile, mobile)
|
||||
}
|
||||
if len(shortRoleNameList) > 0 {
|
||||
sql += " OR t1.market_man_role IN (" + GenQuestionMarks(len(shortRoleNameList)) + ") OR t1.operator_role IN (" + GenQuestionMarks(len(shortRoleNameList)) + ")"
|
||||
sqlParams = append(sqlParams, shortRoleNameList, shortRoleNameList)
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " OR t1.id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
|
||||
Reference in New Issue
Block a user