From 09a6c2525943e2cd4ffeaa49d38a6168494e7888 Mon Sep 17 00:00:00 2001 From: lewis <604446095@qq.com> Date: Thu, 20 Mar 2025 15:04:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E8=B4=A2=E5=8A=A1=E6=BA=AF?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/delivery_service/DeliveryServiceLogic.php | 4 ++-- app/admin/logic/warehouse_product/WarehouseProductLogic.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/delivery_service/DeliveryServiceLogic.php b/app/admin/logic/delivery_service/DeliveryServiceLogic.php index 69231458..1f978cbd 100644 --- a/app/admin/logic/delivery_service/DeliveryServiceLogic.php +++ b/app/admin/logic/delivery_service/DeliveryServiceLogic.php @@ -99,7 +99,7 @@ class DeliveryServiceLogic extends BaseLogic public static function addPurchaseFunds($uid, $amount) { - $model = DeliveryService::findOrEmpty($uid); + $model = DeliveryService::where('uid', $uid)->findOrEmpty(); if (!$model->isEmpty()) { $model->purchase_funds_total = bcadd($model->purchase_funds_total, $amount, 2); $model->current_purchase_funds = bcadd($model->current_purchase_funds, $amount, 2); @@ -109,7 +109,7 @@ class DeliveryServiceLogic extends BaseLogic public static function subPurchaseFunds($uid, $amount) { - $model = DeliveryService::findOrEmpty($uid); + $model = DeliveryService::where('uid', $uid)->findOrEmpty(); if (!$model->isEmpty()) { $model->current_purchase_funds = bcsub($model->current_purchase_funds, $amount, 2); $model->save(); diff --git a/app/admin/logic/warehouse_product/WarehouseProductLogic.php b/app/admin/logic/warehouse_product/WarehouseProductLogic.php index 6fde2a0a..20c0f78c 100644 --- a/app/admin/logic/warehouse_product/WarehouseProductLogic.php +++ b/app/admin/logic/warehouse_product/WarehouseProductLogic.php @@ -2,6 +2,7 @@ namespace app\admin\logic\warehouse_product; +use app\admin\logic\delivery_service\DeliveryServiceLogic; use app\admin\logic\product_source_link\ProductSourceLinkLogic; use app\admin\logic\product_source_link_info\ProductSourceLinkInfoLogic; use app\admin\logic\store_branch_product\StoreBranchProductLogic; @@ -130,6 +131,7 @@ class WarehouseProductLogic extends BaseLogic 'warehouse_id' => $params['warehouse_id'], 'link_id' => $res['id'], ]); + DeliveryServiceLogic::subPurchaseFunds($params['buyer_id'], $params['total_price']); return $res; } catch (\Throwable $e) { throw new BusinessException($e->getMessage());