- 角色管理初版
This commit is contained in:
@@ -153,3 +153,25 @@ func GetStoreListByMobile(db *DaoDB, mobile string) (storeList []*StoreWithCityN
|
||||
}
|
||||
return storeList, err
|
||||
}
|
||||
|
||||
func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, storeIDs []int) (storeList []*StoreWithCityName, err error) {
|
||||
sql := `
|
||||
SELECT t1.*, t2.name city_name
|
||||
FROM store t1
|
||||
LEFT JOIN place t2 ON t2.code = t1.city_code
|
||||
WHERE t1.deleted_at = ? AND ( 1 = 0`
|
||||
sqlParams := []interface{}{
|
||||
utils.DefaultTimeValue,
|
||||
}
|
||||
if mobile != "" {
|
||||
sql += " OR t1.market_man_phone = ? OR t1.operator_phone = ?"
|
||||
sqlParams = append(sqlParams, mobile, mobile)
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " OR t1.id IN (" + GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
}
|
||||
sql += ")"
|
||||
err = GetRows(db, &storeList, sql, sqlParams...)
|
||||
return storeList, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user