|
|
@@ -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) { |
|
|
|