|
@@ -124,9 +124,13 @@ class Orders extends Api
|
|
|
$order['num_install']=$info['num_install'];
|
|
|
$order['tax']=$data['tax']??null;
|
|
|
$order->save();
|
|
|
+ $amount_profit=0;
|
|
|
foreach ($info['goods'] as $everyGoods){
|
|
|
- OrderInfo::saveInfo($order,$everyGoods);
|
|
|
+ $orderInfo=OrderInfo::saveInfo($order,$everyGoods);
|
|
|
+ $amount_profit=bcadd($amount_profit,$orderInfo['amount_profit']);
|
|
|
}
|
|
|
+ $order['amount_profit']=$amount_profit;
|
|
|
+ $order['amount_profit_per']=bcmul(100,bcdiv($order['amount_profit'],$order['amount_pay']));
|
|
|
$order->address()->save($address->orderAddress());
|
|
|
|
|
|
Db::commit();
|