From b09916f47c1b011f1d93737abcc751fcb74242b0 Mon Sep 17 00:00:00 2001 From: "LAPTOP-7SGDREK0\\shiweijun" <411582373@qq.com> Date: Wed, 19 Feb 2025 11:38:15 +0800 Subject: [PATCH] fix:depot --- app/Service/Admin/Depot/DepotService.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/Service/Admin/Depot/DepotService.php b/app/Service/Admin/Depot/DepotService.php index 7a75d9b..c6a9f9f 100644 --- a/app/Service/Admin/Depot/DepotService.php +++ b/app/Service/Admin/Depot/DepotService.php @@ -143,18 +143,8 @@ class DepotService extends BaseService{ public function purchase():array { $depotId = (int)$this->request->input('depot_id'); - $depotInfo = $this->DepotModel->getInfoById($depotId); - if (empty($depotInfo)) throw new ErrException('仓库不存在'); - $materialId = (int)$this->request->input('material_id'); - $materialInfo = $this->MaterialModel->getInfoById($materialId); - if (empty($materialInfo)) throw new ErrException("材料不存在"); - $supplierId = (int)$this->request->input('supplier_id'); - if (!empty($supplierId)){ - $supplierInfo = $this->SupplierModel->getInfoById($supplierId); - if (empty($supplierInfo)) throw new ErrException('供应商不存在'); - } $purchase_price = (double)$this->request->input('purchase_price'); $number = (double)$this->request->input('number'); @@ -626,6 +616,10 @@ class DepotService extends BaseService{ ->where('id',$id) ->first(); + if ($info->status == MaterialCode::AUDITED){ + throw new ErrException('该回收已审核通过'); + } + $info->is_del = MaterialCode::IS_DEL; $materialStock = $this->MaterialStockModel