|
|
@@ -74,6 +74,10 @@ class PurchaseOrderClass extends BaseClass
|
|
|
$data['smallNum'] = $smallNum;
|
|
|
$data['price'] = $totalItemPrice;
|
|
|
|
|
|
+ //包装重量 shish 20210614
|
|
|
+ $data['packWeight'] = isset($data['packWeight']) && is_numeric($data['packWeight']) ? $data['packWeight'] : 0;
|
|
|
+ $totalItemWeight = bcadd($totalItemWeight, $data['packWeight'], 2);
|
|
|
+
|
|
|
//计算订单总价
|
|
|
$data['packingCharge'] = empty($data['packingCharge']) ? 0 : $data['packingCharge'];
|
|
|
$data['shortCharge'] = empty($data['shortCharge']) ? 0 : $data['shortCharge'];
|
|
|
@@ -94,9 +98,25 @@ class PurchaseOrderClass extends BaseClass
|
|
|
$orderPrice = bcadd($orderPrice, $longCharge, 2);
|
|
|
$orderPrice = bcadd($orderPrice, $pickCharge, 2);
|
|
|
$orderPrice = bcadd($orderPrice, $localCharge, 2);
|
|
|
+
|
|
|
$data['orderPrice'] = $orderPrice;
|
|
|
$data['prePrice'] = $orderPrice;
|
|
|
+
|
|
|
+ if (isset($data['modifyPrice'])) {
|
|
|
+ //商家打折,修改金额
|
|
|
+ $modifyPrice = $data['modifyPrice'] ?? 0;
|
|
|
+ if ($modifyPrice > $orderPrice) {
|
|
|
+ util::fail('实收金额大于订单总金额');
|
|
|
+ }
|
|
|
+ if ($modifyPrice < $orderPrice) {
|
|
|
+ $data['discountAmount'] = bcsub($orderPrice, $modifyPrice, 2);
|
|
|
+ $data['discountType'] = dict::getDict('discountType', 'discount');
|
|
|
+ $orderPrice = $modifyPrice;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //实付款
|
|
|
$data['actPrice'] = $orderPrice;
|
|
|
+ //实付款,扣除平台补贴
|
|
|
$data['realPrice'] = $orderPrice;
|
|
|
|
|
|
//总运费
|