|
@@ -429,7 +429,10 @@ class CheckService extends Service
|
|
|
if(! $bool) return [false,'合同生成失败!'];
|
|
|
|
|
|
//反写数据
|
|
|
- $rate = ($product_total + $order['other_fee'] - $order['discount_fee']) / ($product_total + $order['other_fee'] ?? 1);
|
|
|
+
|
|
|
+ $tmp = $product_total + $order['other_fee'];
|
|
|
+ $tmp = $tmp > 0 ? $tmp : 1;
|
|
|
+ $rate = ($product_total + $order['other_fee'] - $order['discount_fee']) / $tmp;
|
|
|
SalesOrder::where('id',$sales_order_id)->update([
|
|
|
'product_total' => $product_total,
|
|
|
'rate' =>$rate
|