|
|
@@ -793,7 +793,7 @@ class OrderController extends BaseController
|
|
|
{
|
|
|
ini_set('date.timezone', 'Asia/Shanghai');
|
|
|
$post = Yii::$app->request->post();
|
|
|
- $payWay = isset($post['payWay']) ? $post['payWay'] : 0;
|
|
|
+ $payWay = $post['payWay'] ?? 0;
|
|
|
$shopId = $this->shopId;
|
|
|
$shop = $this->shop;
|
|
|
if (empty($shop)) {
|
|
|
@@ -846,13 +846,13 @@ class OrderController extends BaseController
|
|
|
$post['sjId'] = $this->sjId;
|
|
|
$post['store'] = 0;
|
|
|
$post['customId'] = $customId;
|
|
|
- $user = isset($this->user->attributes) ? $this->user->attributes : [];
|
|
|
- $post['bookName'] = isset($user['userName']) ? $user['userName'] : '';
|
|
|
+ $user = $this->user->attributes ?? [];
|
|
|
+ $post['bookName'] = $user['userName'] ?? '';
|
|
|
$bookMobile = !empty($post['bookMobile']) && stringUtil::isMobile($post['bookMobile']) ? $post['bookMobile'] : '';
|
|
|
$bookMobile = empty($bookMobile) && !empty($user['mobile']) ? $user['mobile'] : $bookMobile;
|
|
|
$post['bookMobile'] = $bookMobile;
|
|
|
$prePrice = round($post['prePrice'], 2);
|
|
|
- $couponId = isset($post['couponId']) ? $post['couponId'] : 0;
|
|
|
+ $couponId = $post['couponId'] ?? 0;
|
|
|
$discountData = OrderService::getDiscountPrice(['price' => $prePrice, 'sourceType' => 0, 'couponId' => $couponId, 'userId' => $this->userId]);
|
|
|
$actPrice = $discountData['price'];
|
|
|
$post['discountType'] = $discountData['discountType'];
|
|
|
@@ -966,7 +966,7 @@ class OrderController extends BaseController
|
|
|
util::fail('支付失败');
|
|
|
}
|
|
|
|
|
|
- $newParams = isset($response['resp_data']['acc_resp_fields']) ? $response['resp_data']['acc_resp_fields'] : [];
|
|
|
+ $newParams = $response['resp_data']['acc_resp_fields'] ?? [];
|
|
|
$appId = $newParams['app_id'] ?? '';
|
|
|
$nonceStr = $newParams['nonce_str'] ?? '';
|
|
|
$paySign = $newParams['pay_sign'] ?? '';
|