fix:depot_purchase

This commit is contained in:
LAPTOP-7SGDREK0\shiweijun
2025-02-18 11:11:58 +08:00
parent e9eb3f238a
commit 1623571572
2 changed files with 5 additions and 5 deletions

View File

@@ -195,6 +195,7 @@ class DepotService extends BaseService{
else{
//库存增加
$materialStock->current_stock = $materialStock->current_stock + $number;
$materialStock->unit_price = $purchase_price;
}
if (!$depotPurchase->save() || !$materialStock->save()) throw new ErrException('采购添加失败');
@@ -298,6 +299,7 @@ class DepotService extends BaseService{
->when($kitchenId,function ($query) use ($kitchenId) {
$query->where('depot_purchase.kitchen_id',$kitchenId);
})
->orderBy('depot_purchase.create_time','desc')
->paginate($limit,['depot_purchase.*','material.name as material_name','supplier.name as supplier_name','depot.name as depot_name'])
->toArray();