|
@@ -57,6 +57,10 @@ class OrderInfo extends Model
|
|
|
$orderInfo['amount_goods_real']=$goods['amount_goods_real'];
|
|
|
$orderInfo['category_id']=$goods['goods']['category_id'];
|
|
|
$orderInfo['category_name']=Category::withTrashed()->where('id',$orderInfo['category_id'])->value('name');
|
|
|
+ #毛利率
|
|
|
+ $orderInfo['amount_profit']=bcsub($orderInfo['amount_pay'],$orderInfo['amount_cost_total']);
|
|
|
+ $orderInfo['amount_profit_per']=bcmul(100,bcdiv($orderInfo['amount_profit'],$orderInfo['amount_pay']));
|
|
|
+
|
|
|
if(!$orderInfo->save()){
|
|
|
throw_user('保存失败');
|
|
|
}
|