From 1623571572b090d9529a9b4e20016b93d14dd081 Mon Sep 17 00:00:00 2001 From: "LAPTOP-7SGDREK0\\shiweijun" <411582373@qq.com> Date: Tue, 18 Feb 2025 11:11:58 +0800 Subject: [PATCH] fix:depot_purchase --- app/Service/Admin/Depot/DepotService.php | 2 ++ sync/http/admin/auth.http | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) 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