Showing
1 changed file
with
21 additions
and
42 deletions
@@ -36,8 +36,7 @@ class IndexController extends AbstractAction | @@ -36,8 +36,7 @@ class IndexController extends AbstractAction | ||
36 | 36 | ||
37 | if ($isWeixin) { | 37 | if ($isWeixin) { |
38 | $this->go(Helpers::url('/passport/login/wechat', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN)))); | 38 | $this->go(Helpers::url('/passport/login/wechat', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN)))); |
39 | - } | ||
40 | - else { | 39 | + } else { |
41 | $this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN)))); | 40 | $this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN)))); |
42 | } | 41 | } |
43 | } | 42 | } |
@@ -82,8 +81,7 @@ class IndexController extends AbstractAction | @@ -82,8 +81,7 @@ class IndexController extends AbstractAction | ||
82 | 81 | ||
83 | if (empty($result)) { | 82 | if (empty($result)) { |
84 | echo ' '; | 83 | echo ' '; |
85 | - } | ||
86 | - else { | 84 | + } else { |
87 | $this->echoJson($result); | 85 | $this->echoJson($result); |
88 | } | 86 | } |
89 | } | 87 | } |
@@ -215,8 +213,7 @@ class IndexController extends AbstractAction | @@ -215,8 +213,7 @@ class IndexController extends AbstractAction | ||
215 | $this->_view->display('gift-info', array( | 213 | $this->_view->display('gift-info', array( |
216 | 'cartInfo' => $result | 214 | 'cartInfo' => $result |
217 | )); | 215 | )); |
218 | - } | ||
219 | - else { | 216 | + } else { |
220 | echo ' '; | 217 | echo ' '; |
221 | } | 218 | } |
222 | } | 219 | } |
@@ -374,33 +371,28 @@ class IndexController extends AbstractAction | @@ -374,33 +371,28 @@ class IndexController extends AbstractAction | ||
374 | $userMobile = empty($userData['data']) || empty($userData['data']['mobile']) ? '' : $userData['data']['mobile']; //用户手机 | 371 | $userMobile = empty($userData['data']) || empty($userData['data']['mobile']) ? '' : $userData['data']['mobile']; //用户手机 |
375 | $mobile = $userMobile; | 372 | $mobile = $userMobile; |
376 | $addresslist = UserData::addressTextData($uid); //获取地址列表 | 373 | $addresslist = UserData::addressTextData($uid); //获取地址列表 |
377 | - do{ | ||
378 | - if (empty($orderInfo['receiverMobile']) && !isset($orderInfo['addressId']) &&empty($orderInfo['addressId'])) { | 374 | + do { |
375 | + if (empty($orderInfo['receiverMobile']) && !isset($orderInfo['addressId']) && empty($orderInfo['addressId'])) { | ||
379 | break; | 376 | break; |
380 | } | 377 | } |
381 | //用户手动修改号码后直接去修改后号码 | 378 | //用户手动修改号码后直接去修改后号码 |
382 | if (!empty($orderInfo['receiverMobile']) && $orderInfo['isModifyTel'] == true) { | 379 | if (!empty($orderInfo['receiverMobile']) && $orderInfo['isModifyTel'] == true) { |
383 | $mobile = $orderInfo['receiverMobile']; //用户号码 | 380 | $mobile = $orderInfo['receiverMobile']; //用户号码 |
384 | - } | ||
385 | - else { | 381 | + } else { |
386 | //未手动修改获取用户所选地址的手机号码 | 382 | //未手动修改获取用户所选地址的手机号码 |
387 | foreach ($addresslist['data'] as $addresskey) { | 383 | foreach ($addresslist['data'] as $addresskey) { |
388 | - if ($addresskey['address_id'] == Encryption::decrypt($orderInfo['addressId'])) | ||
389 | - { | 384 | + if ($addresskey['address_id'] == Encryption::decrypt($orderInfo['addressId'])) { |
390 | $mobile = $addresskey['mobile']; | 385 | $mobile = $addresskey['mobile']; |
391 | } | 386 | } |
392 | } | 387 | } |
393 | } | 388 | } |
394 | - } | ||
395 | - | ||
396 | - while(false); | 389 | + } while (false); |
397 | if (!empty($orderInfo['invoiceType']) && !empty($orderInfo['invoiceTitle'])) { | 390 | if (!empty($orderInfo['invoiceType']) && !empty($orderInfo['invoiceTitle'])) { |
398 | $invoiceType = $orderInfo['invoiceType']; //发票类型ID | 391 | $invoiceType = $orderInfo['invoiceType']; //发票类型ID |
399 | $invoices_type = $orderInfo['invoicesType'] * 1; //发票类型 /**纸质 1 ,电子 2 */ | 392 | $invoices_type = $orderInfo['invoicesType'] * 1; //发票类型 /**纸质 1 ,电子 2 */ |
400 | $invoices_title = $orderInfo['invoiceText']; //发票抬头 | 393 | $invoices_title = $orderInfo['invoiceText']; //发票抬头 |
401 | $invoice_Top = $orderInfo['invoiceTitle']; //单位 个人 | 394 | $invoice_Top = $orderInfo['invoiceTitle']; //单位 个人 |
402 | - } | ||
403 | - else { | 395 | + } else { |
404 | $invoices_title = ''; | 396 | $invoices_title = ''; |
405 | $invoiceType = '7'; //发票类型ID | 397 | $invoiceType = '7'; //发票类型ID |
406 | // $invoices_type = '1'; //发票类型 /**纸质 1 ,电子 2 */ | 398 | // $invoices_type = '1'; //发票类型 /**纸质 1 ,电子 2 */ |
@@ -511,10 +503,9 @@ class IndexController extends AbstractAction | @@ -511,10 +503,9 @@ class IndexController extends AbstractAction | ||
511 | $skuList = $this->post('skuList', ''); | 503 | $skuList = $this->post('skuList', ''); |
512 | $type = $this->post('type', null); | 504 | $type = $this->post('type', null); |
513 | //type : tickets 门票 | 505 | //type : tickets 门票 |
514 | - if ($type !== 'tickets' ) { | 506 | + if ($type !== 'tickets') { |
515 | $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $skuList); | 507 | $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $skuList); |
516 | - } | ||
517 | - //非门票 | 508 | + } //非门票 |
518 | else { | 509 | else { |
519 | $result = CartModel::ticketsOrderCompute($uid, $productSku, $buyNumber, $yohoCoin); | 510 | $result = CartModel::ticketsOrderCompute($uid, $productSku, $buyNumber, $yohoCoin); |
520 | } | 511 | } |
@@ -554,8 +545,7 @@ class IndexController extends AbstractAction | @@ -554,8 +545,7 @@ class IndexController extends AbstractAction | ||
554 | if (empty($result)) { | 545 | if (empty($result)) { |
555 | // 这儿需要返回空数组,勿改!!! | 546 | // 这儿需要返回空数组,勿改!!! |
556 | echo '[]'; | 547 | echo '[]'; |
557 | - } | ||
558 | - else { | 548 | + } else { |
559 | $this->echoJson($result); | 549 | $this->echoJson($result); |
560 | } | 550 | } |
561 | } | 551 | } |
@@ -650,7 +640,7 @@ class IndexController extends AbstractAction | @@ -650,7 +640,7 @@ class IndexController extends AbstractAction | ||
650 | $unionKey = '{"client_id": 800' . $_COOKIE['mkt_code'] . '}'; | 640 | $unionKey = '{"client_id": 800' . $_COOKIE['mkt_code'] . '}'; |
651 | } else { | 641 | } else { |
652 | $encryData = trim(Encryption::decrypt($_COOKIE['_QYH_UNION'])); | 642 | $encryData = trim(Encryption::decrypt($_COOKIE['_QYH_UNION'])); |
653 | - $extraIndex = strrpos($encryData, '}') + 1; | 643 | + $extraIndex = strrpos($encryData, '}') + 1; |
654 | $encryObject = substr($encryData, 0, $extraIndex); | 644 | $encryObject = substr($encryData, 0, $extraIndex); |
655 | $testQyhUnion = json_decode($encryObject, true); | 645 | $testQyhUnion = json_decode($encryObject, true); |
656 | 646 | ||
@@ -673,28 +663,18 @@ class IndexController extends AbstractAction | @@ -673,28 +663,18 @@ class IndexController extends AbstractAction | ||
673 | // 记录下单异常的数据 | 663 | // 记录下单异常的数据 |
674 | if (empty($result)) { | 664 | if (empty($result)) { |
675 | $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime | 665 | $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime |
676 | - . ',deliveryWay:' . $deliveryWay . ',yohoCoin:' . $yohoCoin | ||
677 | - . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; | 666 | + . ',deliveryWay:' . $deliveryWay . ',yohoCoin:' . $yohoCoin |
667 | + . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; | ||
678 | error_log($message, 3, '/Data/logs/php/h5_error/order.' . date('Ym') . '.log'); | 668 | error_log($message, 3, '/Data/logs/php/h5_error/order.' . date('Ym') . '.log'); |
679 | UdpLog::info('【下单】下单异常数据', 'message:' . $message, '返回:' . json_encode($result)); | 669 | UdpLog::info('【下单】下单异常数据', 'message:' . $message, '返回:' . json_encode($result)); |
680 | - } | ||
681 | - // 返回数据 | 670 | + } // 返回数据 |
682 | else { | 671 | else { |
683 | // 提交成功清除Cookie | 672 | // 提交成功清除Cookie |
684 | $this->setCookie('order-info', null); | 673 | $this->setCookie('order-info', null); |
685 | 674 | ||
686 | $this->echoJson($result); | 675 | $this->echoJson($result); |
687 | } | 676 | } |
688 | - | ||
689 | - /* if ($uid && !empty($result['data'])) { | ||
690 | - try { | ||
691 | - UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']); | ||
692 | - } catch (Exception $e) { | ||
693 | - // do nothing | ||
694 | - } | ||
695 | - } */ | ||
696 | - } | ||
697 | - else { | 677 | + } else { |
698 | echo ' '; | 678 | echo ' '; |
699 | } | 679 | } |
700 | } | 680 | } |
@@ -758,8 +738,7 @@ class IndexController extends AbstractAction | @@ -758,8 +738,7 @@ class IndexController extends AbstractAction | ||
758 | $this->setTitle('配送信息'); | 738 | $this->setTitle('配送信息'); |
759 | if ($cartType) { | 739 | if ($cartType) { |
760 | $this->setNavHeader('配送信息', $data['returnUrl']); //购物车 | 740 | $this->setNavHeader('配送信息', $data['returnUrl']); //购物车 |
761 | - } | ||
762 | - else { | 741 | + } else { |
763 | $this->setNavHeader('配送信息'); //订单详情页 | 742 | $this->setNavHeader('配送信息'); //订单详情页 |
764 | } | 743 | } |
765 | $this->_view->display('jit-detail', $data); | 744 | $this->_view->display('jit-detail', $data); |
@@ -788,7 +767,7 @@ class IndexController extends AbstractAction | @@ -788,7 +767,7 @@ class IndexController extends AbstractAction | ||
788 | $buyNumber = $this->post('buyNumber'); | 767 | $buyNumber = $this->post('buyNumber'); |
789 | $useYohoCoin = $this->post('useYohoCoin', 0); | 768 | $useYohoCoin = $this->post('useYohoCoin', 0); |
790 | $data = CartData::checkTickets($uid, $productSku, $buyNumber, $useYohoCoin); | 769 | $data = CartData::checkTickets($uid, $productSku, $buyNumber, $useYohoCoin); |
791 | - } while(false); | 770 | + } while (false); |
792 | $this->echoJson($data); | 771 | $this->echoJson($data); |
793 | } | 772 | } |
794 | 773 | ||
@@ -803,7 +782,7 @@ class IndexController extends AbstractAction | @@ -803,7 +782,7 @@ class IndexController extends AbstractAction | ||
803 | if (empty($productSku) || empty($buyNumber)) { | 782 | if (empty($productSku) || empty($buyNumber)) { |
804 | $this->error(); | 783 | $this->error(); |
805 | } | 784 | } |
806 | - $tickets = CartModel::getTickets($uid, $productSku, $buyNumber); | 785 | + $tickets = CartModel::getTickets($uid, $productSku, $buyNumber); |
807 | $this->setTitle('确认订单'); | 786 | $this->setTitle('确认订单'); |
808 | $this->setNavHeader('确认订单', true, false); // 不显示右上角home按钮 | 787 | $this->setNavHeader('确认订单', true, false); // 不显示右上角home按钮 |
809 | 788 | ||
@@ -831,7 +810,7 @@ class IndexController extends AbstractAction | @@ -831,7 +810,7 @@ class IndexController extends AbstractAction | ||
831 | if (isset($data['code'])) { | 810 | if (isset($data['code'])) { |
832 | $result = $data; | 811 | $result = $data; |
833 | } | 812 | } |
834 | - } while(false); | 813 | + } while (false); |
835 | $this->echoJson($result); | 814 | $this->echoJson($result); |
836 | } | 815 | } |
837 | 816 |
-
Please register or login to post a comment