|
|
@@ -186,7 +186,6 @@ class OrderController extends BaseController
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
- $post['product'] = $productList;
|
|
|
$orderValidTime = getenv('ORDER_VALID_TIME') == false ? 600 : getenv('ORDER_VALID_TIME');
|
|
|
$post['deadline'] = time() + $orderValidTime;
|
|
|
$post['reachDate'] = isset($post['reachDate']) && !empty($post['reachDate']) ? $post['reachDate'] : date("Y-m-d");
|
|
|
@@ -200,7 +199,7 @@ class OrderController extends BaseController
|
|
|
//各个等级对应的price addPrice字段
|
|
|
$priceMap = \bizGhs\custom\classes\CustomClass::$levelPriceKeyMap;
|
|
|
$addPriceMap = \bizGhs\custom\classes\CustomClass::$levelAddPriceKeyMap;
|
|
|
- foreach ($productList as $element) {
|
|
|
+ foreach ($productList as $eleKey => $element) {
|
|
|
$level = 0;
|
|
|
$productId = $element['productId'];
|
|
|
$current = $productInfoList[$productId];
|
|
|
@@ -211,8 +210,13 @@ class OrderController extends BaseController
|
|
|
$num = $element['num'] ?? 0;
|
|
|
$currentTotal = bcmul($price, $num, 2);
|
|
|
$modifyPrice = bcadd($modifyPrice, $currentTotal, 2);
|
|
|
+ $productList[$eleKey]['unitPrice'] = $price;
|
|
|
}
|
|
|
+ $post['product'] = $productList;
|
|
|
$post['modifyPrice'] = $modifyPrice;
|
|
|
+ print_r($post);
|
|
|
+ die;
|
|
|
+ //多处调用这个方法,注意同步修改,搜索关键词 createHdNewOrder
|
|
|
$return = \bizHd\order\services\OrderService::createHdOrder($post, $custom, $hasPay);
|
|
|
if (isset($return->shopId)) {
|
|
|
if ($return->shopId == 7610) {
|