- GetSkuNames keyword可搜索upc

This commit is contained in:
gazebo
2019-04-15 15:04:57 +08:00
parent a6dfc8dbda
commit ba85c710b5

View File

@@ -207,8 +207,8 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma
}
if keyword != "" {
keywordLike := "%" + keyword + "%"
sql += " AND (t1.name LIKE ? OR t1.prefix LIKE ? OR t2.comment LIKE ?"
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike)
sql += " AND (t1.name LIKE ? OR t1.prefix LIKE ? OR t2.comment LIKE ? OR t1.upc LIKE ?"
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike)
if keywordInt64, err2 := strconv.ParseInt(keyword, 10, 64); err2 == nil {
sql += " OR t2.jd_id = ? OR t1.id = ? OR t1.category_id = ?"