From 694c83379a9cc5ab2418128d7241b44f4a986933 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 24 Aug 2024 10:39:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=96=B9=E5=BC=8F=E4=BB=A5=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=95=86=E5=93=81=E9=94=80=E5=94=AE=E6=9B=B4=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 98cec7915..45122cc5c 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -578,13 +578,13 @@ class PayNotifyLogic extends BaseLogic $branchProduct=StoreBranchProduct::where('product_id', $v['product_id'])->where('store_id',$v['store_id'])->find(); if($branchProduct){ $stock=bcsub($branchProduct['stock'],$v['cart_num'],2); - $branchProduct->update(['stock'=>$stock,'total_price'=>bcmul($stock,$branchProduct['purchase'],2), + StoreProduct::where('id',$branchProduct['id'])->update(['stock'=>$stock,'total_price'=>bcmul($stock,$branchProduct['purchase'],2), 'sales'=>bcmul($branchProduct['sales'],$v['cart_num'],2)]); } $storeProduct=StoreProduct::where('id', $v['product_id'])->find(); if($storeProduct){ $stock=bcsub($storeProduct['stock'],$v['cart_num'],2); - $storeProduct->update(['stock'=>$stock,'total_price'=>bcmul($stock,$storeProduct['purchase'],2), + StoreProduct::where('id', $v['product_id'])->update(['stock'=>$stock,'total_price'=>bcmul($stock,$storeProduct['purchase'],2), 'sales'=>bcmul($storeProduct['sales'],$v['cart_num'],2)]); } }