fix keyword查询时没有name的bug

This commit is contained in:
timerzz 2024-12-02 16:44:09 +08:00
parent 38d95b7074
commit 2e26da0a8a

View File

@ -124,7 +124,7 @@ func (g *GetProviderArticleQuery) Scope(db *gorm.DB) *gorm.DB {
db = db.Where("trace_ats=?", *g.TraceAts)
}
if g.Keyword != "" {
db = db.Where("(name ilike ? or sku_id ilike ?)", "%"+g.Keyword+"%", "%"+g.Keyword+"%")
db = db.Where("sku_id ilike ?", "%"+g.Keyword+"%", "%"+g.Keyword+"%")
}
return db
}