添加Store.OperatorPhone2

门店搜索支持电话号码
This commit is contained in:
gazebo
2019-10-08 14:18:44 +08:00
parent 55aeeacc40
commit 34506d08a9
5 changed files with 32 additions and 19 deletions

View File

@@ -99,7 +99,7 @@ func GetStoreListByMobile(db *DaoDB, mobile string) (storeList []*StoreWithCityN
FROM (
SELECT *
FROM store t1
WHERE (t1.market_man_phone = ? OR t1.operator_phone = ?)
WHERE (t1.market_man_phone = ? OR t1.operator_phone = ? OR t1.operator_phone2 = ?)
UNION DISTINCT
SELECT t1.*
FROM store t1
@@ -111,6 +111,7 @@ func GetStoreListByMobile(db *DaoDB, mobile string) (storeList []*StoreWithCityN
WHERE t1.deleted_at = ?
ORDER BY t1.name`
sqlParams := []interface{}{
mobile,
mobile,
mobile,
mobile,
@@ -132,8 +133,8 @@ func GetStoreListByMobileOrStoreIDs(db *DaoDB, mobile string, shortRoleNameList
utils.DefaultTimeValue,
}
if mobile != "" {
sql += " OR t1.market_man_phone = ? OR t1.operator_phone = ?"
sqlParams = append(sqlParams, mobile, mobile)
sql += " OR t1.market_man_phone = ? OR t1.operator_phone = ? OR t1.operator_phone2 = ?"
sqlParams = append(sqlParams, mobile, mobile, mobile)
}
if len(shortRoleNameList) > 0 {
questionMarks := GenQuestionMarks(len(shortRoleNameList))