feat: 增加蝦皮店铺名称搜索 (#182)
This commit is contained in:
@@ -131,10 +131,11 @@ type ShopeeProductRow struct {
|
||||
// 认不出的取值一律当作 ""(不筛选),由 service 层的 ParseShopeeStatus 兜底,
|
||||
// 这里不做校验——repository 只管拼 SQL。
|
||||
type ShopeeFilter struct {
|
||||
Keyword string
|
||||
Status string
|
||||
Shop string // has / missing / 空(全部)
|
||||
Image string // has / missing / 空(全部)
|
||||
Keyword string
|
||||
ShopName string
|
||||
Status string
|
||||
Shop string // has / missing / 空(全部)
|
||||
Image string // has / missing / 空(全部)
|
||||
}
|
||||
|
||||
// shopeeFilterClause 把关键字、状态、店铺和图片筛选拼成 WHERE 子句,供 ListShopeeProducts
|
||||
@@ -153,6 +154,10 @@ func shopeeFilterClause(filter ShopeeFilter) (string, []any) {
|
||||
clauses = append(clauses, `(sp.goods_id LIKE ? ESCAPE '!' OR sp.title LIKE ? ESCAPE '!')`)
|
||||
args = append(args, like, like)
|
||||
}
|
||||
if shopName := strings.TrimSpace(filter.ShopName); shopName != "" {
|
||||
clauses = append(clauses, `sp.shopee_shop_name LIKE ? ESCAPE '!'`)
|
||||
args = append(args, "%"+escapeLike(shopName)+"%")
|
||||
}
|
||||
|
||||
switch filter.Status {
|
||||
case "pending_spec":
|
||||
|
||||
Reference in New Issue
Block a user