Authored by hf

do add call order error logs

@@ -422,6 +422,30 @@ class IndexController extends AbstractAction @@ -422,6 +422,30 @@ class IndexController extends AbstractAction
422 $couponCode = $this->post('couponCode', null); 422 $couponCode = $this->post('couponCode', null);
423 $yohoCoin = $this->post('yohoCoin', 1); 423 $yohoCoin = $this->post('yohoCoin', 1);
424 $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin); 424 $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
  425 +
  426 + // 记录下单异常的数据
  427 + if (empty($result)) {
  428 + $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime
  429 + . ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin
  430 + . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n";
  431 + error_log($message, 3, '/Data/logs/php/h5_error/order.' . date('Ym') . '.log');
  432 + }
  433 + else {
  434 + // 提交成功清除Cookie
  435 + $this->setCookie('order-info', null);
  436 +
  437 + $this->echoJson($result);
  438 + }
  439 +
  440 +
  441 + if ($uid && !empty($result['data'])) {
  442 + try {
  443 + UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']);
  444 + } catch (Exception $e) {
  445 + // do nothing
  446 + }
  447 + }
  448 +
425 } 449 }
426 450
427 if (empty($result)) { 451 if (empty($result)) {
@@ -432,13 +456,6 @@ class IndexController extends AbstractAction @@ -432,13 +456,6 @@ class IndexController extends AbstractAction
432 456
433 $this->echoJson($result); 457 $this->echoJson($result);
434 458
435 - if ($uid && !empty($result['data'])) {  
436 - try {  
437 - UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']);  
438 - } catch (Exception $e) {  
439 - // do nothing  
440 - }  
441 - }  
442 } 459 }
443 } 460 }
444 461