- 角色管理初版

This commit is contained in:
gazebo
2019-08-07 18:16:44 +08:00
parent 059be1befd
commit 3639a1c7cb
14 changed files with 500 additions and 72 deletions

View File

@@ -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
}