fix
This commit is contained in:
parent
5b9a814fbb
commit
b012db8e4e
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ func (l *GetCloudListLogic) GetCloudList(req *types.GetCloudListReq, userinfo *a
|
|||
mapProductDesign[v.Id] = v
|
||||
}
|
||||
//获取尺寸信息
|
||||
sizeList, err := l.svcCtx.AllModels.FsProductSize.GetAllByProductIdsWithoutStatus(l.ctx, sizeIds, "")
|
||||
sizeList, err := l.svcCtx.AllModels.FsProductSize.GetAllByIdsWithoutStatus(l.ctx, sizeIds, "")
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeDbSqlErr, "failed to get product size list")
|
||||
|
|
Loading…
Reference in New Issue
Block a user