refactor: 优化数据库查询构建链式调用
This commit is contained in:
@@ -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.TableNameStockBatch).OmitEmpty().Where(entity.StockBatchCol.Id, req.Id)
|
||||
model := gfdb.DB(ctx).Model(ctx, public.TableNameStockBatch).Where(entity.StockBatchCol.Id, req.Id)
|
||||
model.Data(entity.StockBatchCol.BatchQty, &gdb.Counter{
|
||||
Field: entity.StockBatchCol.BatchQty,
|
||||
Value: gconv.Float64(req.BatchQty),
|
||||
|
||||
Reference in New Issue
Block a user