diff --git a/app/Service/Admin/Depot/DepotService.php b/app/Service/Admin/Depot/DepotService.php index 0a9c694..19f75cd 100644 --- a/app/Service/Admin/Depot/DepotService.php +++ b/app/Service/Admin/Depot/DepotService.php @@ -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(); diff --git a/sync/http/admin/auth.http b/sync/http/admin/auth.http index e77d788..521feec 100644 --- a/sync/http/admin/auth.http +++ b/sync/http/admin/auth.http @@ -387,15 +387,13 @@ POST {{host}}/admin/depot/depot_purchase Content-Type: application/x-www-form-urlencoded Authorization: Bearer {{admin_token}} -depot_id=1&material_id=1&supplier_id=1&purchase_price=60&number=2&city_id=1&kitchen_id=1 +depot_id=1&material_id=1&supplier_id=1&purchase_price=60&number=5&city_id=1&kitchen_id=1 -### 采购数量修改 -POST {{host}}/admin/depot/depot_purchase_update +### 采购退货 +POST {{host}}/admin/depot/depot_purchase_back?id=1 Content-Type: application/x-www-form-urlencoded Authorization: Bearer {{admin_token}} -id=1&number=9 - ### 排菜列表 GET {{host}}/admin/dish/list?limit=10 content-type: application/json