This commit is contained in:
suyl
2021-05-20 16:37:36 +08:00
parent b20449bdfd
commit 6455a5fc26

View File

@@ -4067,9 +4067,13 @@ func GetBrandStore(ctx *jxcontext.Context, name string) (brands []*model.BrandSt
db = dao.GetDB()
)
sql := `
SELECT * FROM brand_store WHERE deleted_at = ? AND name LIKE ?
SELECT * FROM brand_store WHERE deleted_at = ?
`
sqlParams := []interface{}{utils.DefaultTimeValue, "%" + name + "%"}
sqlParams := []interface{}{utils.DefaultTimeValue}
if name != "" {
sql += " AND name LIKE ?"
sqlParams = append(sqlParams, "%"+name+"%")
}
err = dao.GetRows(db, &brands, sql, sqlParams)
return brands, err
}