- fix GetStores bug.

- isFocus on sku name.
This commit is contained in:
gazebo
2018-09-20 12:06:06 +08:00
parent 65e5587cba
commit 582b4c9722
4 changed files with 73 additions and 48 deletions

View File

@@ -48,7 +48,7 @@ func GetStores(keyword string, params map[string]interface{}, offset, pageSize i
sqlParams := make([]interface{}, 0)
if keyword != "" {
keywordLike := "%" + keyword + "%"
sqlWhere += " (t1.name LIKE ? OR t1.address LIKE ? OR t1.tel1 LIKE ? OR t1.tel2 LIKE ? OR t1.last_operator LIKE ? OR city.name LIKE ?"
sqlWhere += " AND (t1.name LIKE ? OR t1.address LIKE ? OR t1.tel1 LIKE ? OR t1.tel2 LIKE ? OR t1.last_operator LIKE ? OR city.name LIKE ?"
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike)
if keywordInt64, err2 := strconv.ParseInt(keyword, 10, 64); err2 == nil {
@@ -56,8 +56,6 @@ func GetStores(keyword string, params map[string]interface{}, offset, pageSize i
sqlParams = append(sqlParams, keywordInt64, keywordInt64, keywordInt64, keywordInt64, keywordInt64)
}
sqlWhere += ")"
} else {
sqlWhere += " 1 = 1"
}
if params["storeID"] != nil {