|
|
@@ -241,10 +241,9 @@ class Order extends Base |
|
|
|
'order_id' => $order_id |
|
|
|
])->select(); |
|
|
|
$list = collection($list)->toArray(); |
|
|
|
print_r($list);die; |
|
|
|
$product = new \app\admin\model\unishop\Product(); |
|
|
|
foreach ($list as $val){ |
|
|
|
$product->where(["id"=>$val['product_id']])->setInc("stock",$val["number"])->setInc("real_sales",-$val["number"]); |
|
|
|
$product->where(["id"=>$val['order_product_id']])->setInc("stock",$val["number"])->setInc("real_sales",-$val["number"]); |
|
|
|
} |
|
|
|
|
|
|
|
if ($order['status'] == \addons\unishop\model\Order::STATUS_NORMAL && $order['have_paid'] == \addons\unishop\model\Order::PAID_NO) { |
|
|
|