diff --git a/model/gmodel/fs_product_size_logic.go b/model/gmodel/fs_product_size_logic.go index ae6f1cf3..032680e6 100755 --- a/model/gmodel/fs_product_size_logic.go +++ b/model/gmodel/fs_product_size_logic.go @@ -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") diff --git a/model/gmodel/fs_user_stock_logic.go b/model/gmodel/fs_user_stock_logic.go index 0814c30f..fb28363b 100644 --- a/model/gmodel/fs_user_stock_logic.go +++ b/model/gmodel/fs_user_stock_logic.go @@ -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) } diff --git a/server/inventory/internal/logic/getcloudlistlogic.go b/server/inventory/internal/logic/getcloudlistlogic.go index e02f7315..81e58acc 100644 --- a/server/inventory/internal/logic/getcloudlistlogic.go +++ b/server/inventory/internal/logic/getcloudlistlogic.go @@ -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")