From e8436d50224e49fcae8bc8254c9e1085921ba452 Mon Sep 17 00:00:00 2001 From: v-Brocloni Date: Fri, 16 Apr 2021 10:56:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/unishop/controller/Order.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/unishop/controller/Order.php b/addons/unishop/controller/Order.php index fa72c7f..fb6af07 100644 --- a/addons/unishop/controller/Order.php +++ b/addons/unishop/controller/Order.php @@ -244,7 +244,8 @@ class Order extends Base $product = new \app\admin\model\unishop\Product(); foreach ($list as $val){ try { - $product->where(["id"=>$val['product_id']])->setInc("stock", $val["number"])->setInc("real_sales",-$val["number"]); + $product->where(["id"=>$val['product_id']])->setInc("stock", $val["number"]); + $product->where(["id"=>$val['product_id']])->setInc("real_sales",-$val["number"]); }catch (Exception $e){ print_r($e);die; }