Authored by 郭成尧

reformat-code

... ... @@ -36,8 +36,7 @@ class IndexController extends AbstractAction
if ($isWeixin) {
$this->go(Helpers::url('/passport/login/wechat', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
}
else {
} else {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
}
}
... ... @@ -82,8 +81,7 @@ class IndexController extends AbstractAction
if (empty($result)) {
echo ' ';
}
else {
} else {
$this->echoJson($result);
}
}
... ... @@ -215,8 +213,7 @@ class IndexController extends AbstractAction
$this->_view->display('gift-info', array(
'cartInfo' => $result
));
}
else {
} else {
echo ' ';
}
}
... ... @@ -374,33 +371,28 @@ class IndexController extends AbstractAction
$userMobile = empty($userData['data']) || empty($userData['data']['mobile']) ? '' : $userData['data']['mobile']; //用户手机
$mobile = $userMobile;
$addresslist = UserData::addressTextData($uid); //获取地址列表
do{
if (empty($orderInfo['receiverMobile']) && !isset($orderInfo['addressId']) &&empty($orderInfo['addressId'])) {
do {
if (empty($orderInfo['receiverMobile']) && !isset($orderInfo['addressId']) && empty($orderInfo['addressId'])) {
break;
}
//用户手动修改号码后直接去修改后号码
if (!empty($orderInfo['receiverMobile']) && $orderInfo['isModifyTel'] == true) {
$mobile = $orderInfo['receiverMobile']; //用户号码
}
else {
} else {
//未手动修改获取用户所选地址的手机号码
foreach ($addresslist['data'] as $addresskey) {
if ($addresskey['address_id'] == Encryption::decrypt($orderInfo['addressId']))
{
if ($addresskey['address_id'] == Encryption::decrypt($orderInfo['addressId'])) {
$mobile = $addresskey['mobile'];
}
}
}
}
while(false);
} while (false);
if (!empty($orderInfo['invoiceType']) && !empty($orderInfo['invoiceTitle'])) {
$invoiceType = $orderInfo['invoiceType']; //发票类型ID
$invoices_type = $orderInfo['invoicesType'] * 1; //发票类型 /**纸质 1 ,电子 2 */
$invoices_title = $orderInfo['invoiceText']; //发票抬头
$invoice_Top = $orderInfo['invoiceTitle']; //单位 个人
}
else {
} else {
$invoices_title = '';
$invoiceType = '7'; //发票类型ID
// $invoices_type = '1'; //发票类型 /**纸质 1 ,电子 2 */
... ... @@ -511,10 +503,9 @@ class IndexController extends AbstractAction
$skuList = $this->post('skuList', '');
$type = $this->post('type', null);
//type : tickets 门票
if ($type !== 'tickets' ) {
if ($type !== 'tickets') {
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $skuList);
}
//非门票
} //非门票
else {
$result = CartModel::ticketsOrderCompute($uid, $productSku, $buyNumber, $yohoCoin);
}
... ... @@ -554,8 +545,7 @@ class IndexController extends AbstractAction
if (empty($result)) {
// 这儿需要返回空数组,勿改!!!
echo '[]';
}
else {
} else {
$this->echoJson($result);
}
}
... ... @@ -650,7 +640,7 @@ class IndexController extends AbstractAction
$unionKey = '{"client_id": 800' . $_COOKIE['mkt_code'] . '}';
} else {
$encryData = trim(Encryption::decrypt($_COOKIE['_QYH_UNION']));
$extraIndex = strrpos($encryData, '}') + 1;
$extraIndex = strrpos($encryData, '}') + 1;
$encryObject = substr($encryData, 0, $extraIndex);
$testQyhUnion = json_decode($encryObject, true);
... ... @@ -673,28 +663,18 @@ class IndexController extends AbstractAction
// 记录下单异常的数据
if (empty($result)) {
$message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime
. ',deliveryWay:' . $deliveryWay . ',yohoCoin:' . $yohoCoin
. ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n";
. ',deliveryWay:' . $deliveryWay . ',yohoCoin:' . $yohoCoin
. ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n";
error_log($message, 3, '/Data/logs/php/h5_error/order.' . date('Ym') . '.log');
UdpLog::info('【下单】下单异常数据', 'message:' . $message, '返回:' . json_encode($result));
}
// 返回数据
} // 返回数据
else {
// 提交成功清除Cookie
$this->setCookie('order-info', null);
$this->echoJson($result);
}
/* if ($uid && !empty($result['data'])) {
try {
UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']);
} catch (Exception $e) {
// do nothing
}
} */
}
else {
} else {
echo ' ';
}
}
... ... @@ -758,8 +738,7 @@ class IndexController extends AbstractAction
$this->setTitle('配送信息');
if ($cartType) {
$this->setNavHeader('配送信息', $data['returnUrl']); //购物车
}
else {
} else {
$this->setNavHeader('配送信息'); //订单详情页
}
$this->_view->display('jit-detail', $data);
... ... @@ -788,7 +767,7 @@ class IndexController extends AbstractAction
$buyNumber = $this->post('buyNumber');
$useYohoCoin = $this->post('useYohoCoin', 0);
$data = CartData::checkTickets($uid, $productSku, $buyNumber, $useYohoCoin);
} while(false);
} while (false);
$this->echoJson($data);
}
... ... @@ -803,7 +782,7 @@ class IndexController extends AbstractAction
if (empty($productSku) || empty($buyNumber)) {
$this->error();
}
$tickets = CartModel::getTickets($uid, $productSku, $buyNumber);
$tickets = CartModel::getTickets($uid, $productSku, $buyNumber);
$this->setTitle('确认订单');
$this->setNavHeader('确认订单', true, false); // 不显示右上角home按钮
... ... @@ -831,7 +810,7 @@ class IndexController extends AbstractAction
if (isset($data['code'])) {
$result = $data;
}
} while(false);
} while (false);
$this->echoJson($result);
}
... ...