This commit is contained in:
laodaming 2023-06-13 19:07:57 +08:00
parent 8b85f3b6ce
commit d523d62abd

View File

@ -52,9 +52,9 @@ func (p *FsProductModel) GetProductListByIds(ctx context.Context, productIds []i
Where("`id` in (?) and `is_del` =? and `is_shelf` = ? and `status` =?", productIds, 0, 1, 1)
switch sort {
case "sort-asc":
db = db.Order("sort ASC")
db = db.Order("`sort` ASC")
case "sort-desc":
db = db.Order("sort DESC")
db = db.Order("`sort` DESC")
}
if err = db.Find(&resp).Error; err != nil {
return nil, err