|
|
@@ -29,7 +29,7 @@ class OrderService extends BaseService
|
|
|
|
|
|
public static function createFinishOrder($data, $custom, $hasPay = 1)
|
|
|
{
|
|
|
- $payWay = $data['payWay'] ?? dict::getDict('payWay', 'wxPay');
|
|
|
+ $payWay = $data['payWay'] ?? 0;
|
|
|
$orderSn = orderSn::getOrderSn();
|
|
|
$customId = $custom['id'] ?? 0;
|
|
|
$hdId = $custom['hdId'] ?? 0;
|
|
|
@@ -163,28 +163,29 @@ class OrderService extends BaseService
|
|
|
$groupGoodsData[] = ['goodsId' => $currentId, 'num' => $num, 'name' => $name, 'unitPrice' => $unitPrice];
|
|
|
}
|
|
|
if ($property == dict::getDict('property', 'item')) {
|
|
|
- $name = $itemInfo[$currentId]['name'] ?? '';
|
|
|
- $cover = $itemInfo[$currentId]['cover'] ?? '';
|
|
|
+ $currentInfo = $itemInfo[$currentId] ?? [];
|
|
|
+ $name = $currentInfo['name'] ?? '';
|
|
|
+ $cover = $currentInfo['cover'] ?? '';
|
|
|
if (!empty($groupCover)) {
|
|
|
$groupCover = $cover;
|
|
|
}
|
|
|
- $ratio = $itemInfo[$currentId]['ratio'] ?? 20;
|
|
|
- $currentMainId = $itemInfo[$currentId]['mainId'] ?? 0;
|
|
|
+ $ratio = $currentInfo['ratio'] ?? 20;
|
|
|
+ $currentMainId = $currentInfo['mainId'] ?? 0;
|
|
|
if ($currentMainId != $mainId) {
|
|
|
util::fail('不是您的花材' . $mainId . ' ' . $currentMainId);
|
|
|
}
|
|
|
if ($unitType == dict::getDict('unitType', 'big')) {
|
|
|
- $unitName = $itemInfo[$currentId]['bigUnit'] ?? '';
|
|
|
- $unitId = $itemInfo[$currentId]['bigUnitId'] ?? 0;
|
|
|
+ $unitName = $currentInfo['bigUnit'] ?? '';
|
|
|
+ $unitId = $currentInfo['bigUnitId'] ?? 0;
|
|
|
$totalNum = $num;
|
|
|
} else {
|
|
|
- $unitName = $itemInfo[$currentId]['smallUnit'] ?? '';
|
|
|
- $unitId = $itemInfo[$currentId]['smallUnitId'] ?? 0;
|
|
|
+ $unitName = $currentInfo['smallUnit'] ?? '';
|
|
|
+ $unitId = $currentInfo['smallUnitId'] ?? 0;
|
|
|
$totalNum = bcdiv($num, $ratio, 2);
|
|
|
}
|
|
|
- $ptItemId = $itemInfo[$currentId]['itemId'] ?? 0;
|
|
|
- $classId = $itemInfo[$currentId]['classId'] ?? 0;
|
|
|
- $belongCost = $itemInfo[$currentId]['belongCost'] ?? 0;
|
|
|
+ $ptItemId = $currentInfo['itemId'] ?? 0;
|
|
|
+ $classId = $currentInfo['classId'] ?? 0;
|
|
|
+ $belongCost = $currentInfo['belongCost'] ?? 0;
|
|
|
$currentItemData = [
|
|
|
'name' => $name,
|
|
|
'cover' => $cover,
|
|
|
@@ -304,6 +305,11 @@ class OrderService extends BaseService
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //hasPay balance 转化成余额支付方式
|
|
|
+ if ($hasPay == dict::getDict('hasPay', 'balance')) {
|
|
|
+ $payWay = dict::getDict('payWay', 'balancePay');
|
|
|
+ }
|
|
|
+
|
|
|
$data['actPrice'] = $modifyPrice;
|
|
|
$data['realPrice'] = $modifyPrice;
|
|
|
$data['customId'] = $customId;
|