Browse Source

调试

yijia
v-Brocloni 3 years ago
parent
commit
da80722541
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      addons/unishop/controller/Order.php

+ 7
- 1
addons/unishop/controller/Order.php View File

@@ -243,7 +243,13 @@ class Order extends Base
$list = collection($list)->toArray();
$product = new \app\admin\model\unishop\Product();
foreach ($list as $val){
$product->where(["id"=>$val['order_product_id']])->setInc("stock",$val["number"])->setInc("real_sales",-$val["number"]);
try {
$product->where(["id"=>$val['order_product_id']]);
$product->setInc("stock", $val["number"],0);
$product->setInc("real_sales",-$val["number"],0);
}catch (Exception $e){
print_r($e);die;
}
}

if ($order['status'] == \addons\unishop\model\Order::STATUS_NORMAL && $order['have_paid'] == \addons\unishop\model\Order::PAID_NO) {


Loading…
Cancel
Save