fix: 更新数据库表名引用及配置
This commit is contained in:
@@ -27,7 +27,7 @@ func (d *stockBatch) Insert(ctx context.Context, req *dto.CreateSockBatchReq) (i
|
||||
if err = gconv.Struct(req, &res); err != nil {
|
||||
return
|
||||
}
|
||||
r, err := gfdb.DB(ctx).Model(ctx, public.StockBatchCollection).Data(&res).Insert()
|
||||
r, err := gfdb.DB(ctx).Model(ctx, public.TableNameStockBatch).Data(&res).Insert()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@@ -35,7 +35,7 @@ func (d *stockBatch) Insert(ctx context.Context, req *dto.CreateSockBatchReq) (i
|
||||
}
|
||||
|
||||
func (d *stockBatch) Update(ctx context.Context, req *dto.UpdateSockBatchReq) (rows int64, err error) {
|
||||
model := gfdb.DB(ctx).Model(ctx, public.StockBatchCollection).OmitEmpty().Where(entity.StockBatchCol.Id, req.Id)
|
||||
model := gfdb.DB(ctx).Model(ctx, public.TableNameStockBatch).OmitEmpty().Where(entity.StockBatchCol.Id, req.Id)
|
||||
model.Data(entity.StockBatchCol.BatchQty, &gdb.Counter{
|
||||
Field: entity.StockBatchCol.BatchQty,
|
||||
Value: gconv.Float64(req.BatchQty),
|
||||
@@ -53,7 +53,7 @@ func (d *stockBatch) Update(ctx context.Context, req *dto.UpdateSockBatchReq) (r
|
||||
|
||||
// One 根据批次号查询(使用NoCache跳过缓存,确保获取最新数据)
|
||||
func (d *stockBatch) One(ctx context.Context, req *dto.GetSockBatchReq, fields ...string) (res *entity.StockBatch, err error) {
|
||||
model := gfdb.DB(ctx).Model(ctx, public.StockBatchCollection)
|
||||
model := gfdb.DB(ctx).Model(ctx, public.TableNameStockBatch)
|
||||
if !g.IsEmpty(req.Id) {
|
||||
model.Where(entity.StockBatchCol.Id, req.Id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user