fix
This commit is contained in:
@@ -48,11 +48,11 @@ func (s *FsProductSizeModel) GetAllByProductIds(ctx context.Context, productIds
|
||||
}
|
||||
return
|
||||
}
|
||||
func (s *FsProductSizeModel) GetAllByProductIdsWithoutStatus(ctx context.Context, productIds []int64, sort string) (resp []FsProductSize, err error) {
|
||||
if len(productIds) == 0 {
|
||||
func (s *FsProductSizeModel) GetAllByIdsWithoutStatus(ctx context.Context, ids []int64, sort string) (resp []FsProductSize, err error) {
|
||||
if len(ids) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
db := s.db.WithContext(ctx).Model(&FsProductSize{}).Where("`product_id` in(?)", productIds)
|
||||
db := s.db.WithContext(ctx).Model(&FsProductSize{}).Where("`id` in(?)", ids)
|
||||
switch sort {
|
||||
case "sort-asc":
|
||||
db = db.Order("`sort` ASC")
|
||||
|
||||
@@ -14,7 +14,7 @@ type GetStockListReq struct {
|
||||
}
|
||||
|
||||
func (s *FsUserStockModel) GetStockList(ctx context.Context, req GetStockListReq) (resp []FsUserStock, total int64, err error) {
|
||||
db := s.db.Debug().WithContext(ctx).Model(&FsUserStock{})
|
||||
db := s.db.WithContext(ctx).Model(&FsUserStock{})
|
||||
if req.UserId > 0 {
|
||||
db = db.Where("`user_id` = ?", req.UserId)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user