|
|
@@ -715,7 +715,10 @@ class Order extends Backend |
|
|
|
$list = collection($order)->toArray(); |
|
|
|
$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"]); |
|
|
|
try { |
|
|
|
$product->where(["id" => $val['product_id']])->setInc("stock", $val["number"])->setInc("real_sales", -$val["number"]); |
|
|
|
} catch (Exception $e) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|