This commit is contained in:
laodaming 2023-06-28 14:55:13 +08:00
parent 5b9a814fbb
commit b012db8e4e
3 changed files with 5 additions and 5 deletions

View File

@ -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")

View File

@ -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)
}

View File

@ -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")