Authored by cailing

电子发票代码返回

@@ -4,6 +4,7 @@ namespace LibModels\Wap\Home; @@ -4,6 +4,7 @@ namespace LibModels\Wap\Home;
4 4
5 use Api\Sign; 5 use Api\Sign;
6 use Api\Yohobuy; 6 use Api\Yohobuy;
  7 +use Plugin\Helpers;
7 8
8 /** 9 /**
9 * 购物车的数据模型 10 * 购物车的数据模型
@@ -365,7 +366,8 @@ class CartData @@ -365,7 +366,8 @@ class CartData
365 * @param int $cartType 购物车类型ID 366 * @param int $cartType 购物车类型ID
366 * @param int $deliveryTime 寄送时间ID 367 * @param int $deliveryTime 寄送时间ID
367 * @param int $deliveryWay 寄送方式ID 368 * @param int $deliveryWay 寄送方式ID
368 - * @param array $invoices 发票参数数组 369 + * @param string $invoiceTitle 发票说明
  370 + * @param int $invoiceId 发票类型ID
369 * @param int $paymentId 支付方式ID 371 * @param int $paymentId 支付方式ID
370 * @param int $paymentType 支付类型ID 372 * @param int $paymentType 支付类型ID
371 * @param string $remark 留言 373 * @param string $remark 留言
@@ -381,28 +383,22 @@ class CartData @@ -381,28 +383,22 @@ class CartData
381 $param = Yohobuy::param(); 383 $param = Yohobuy::param();
382 $param['debug'] = 'Y'; 384 $param['debug'] = 'Y';
383 $param['client_type'] = 'h5'; // 需要ERP统计WAP的下单量 385 $param['client_type'] = 'h5'; // 需要ERP统计WAP的下单量
  386 + if(Helpers::is_weixin()) {
  387 + $param['client_type'] = 'wechat';
  388 + }
384 $param['private_key'] = Yohobuy::$privateKeyList['android']; // H5默认使用Android的私钥 389 $param['private_key'] = Yohobuy::$privateKeyList['android']; // H5默认使用Android的私钥
385 $param['method'] = 'app.Shopping.submit'; 390 $param['method'] = 'app.Shopping.submit';
386 $param['address_id'] = $addressId; 391 $param['address_id'] = $addressId;
387 $param['cart_type'] = $cartType; 392 $param['cart_type'] = $cartType;
388 $param['delivery_time'] = $deliveryTime; 393 $param['delivery_time'] = $deliveryTime;
389 $param['delivery_way'] = $deliveryWay; 394 $param['delivery_way'] = $deliveryWay;
390 - if (!empty($invoices['invoices_type_id'])) {  
391 - //发票内容id--图书:1  
392 - $param['invoice_content'] = $invoices['invoices_type_id'];  
393 - }  
394 - if (!empty($invoices['invoices_type'])) {  
395 - //数字类型 发票类型 /**纸质 1 ,电子 2 */  
396 - $param['invoices_type'] = $invoices['invoices_type']; 395 + if (!empty($invoiceTitle)) {
  396 + $param['invoices_title'] = $invoiceTitle;
397 } 397 }
398 - if (!empty($invoices['receiverMobile'])) {  
399 - //发票人手机  
400 - $param['receiverMobile'] = $invoices['receiverMobile'];  
401 - }  
402 - if (!empty($invoices['invoices_title'])) {  
403 - //发票抬头 OR 填写单位名称,这二个是一个意思,只是叫法不一样  
404 - $param['invoices_title'] = $invoices['invoices_title']; 398 + if (!empty($invoiceId)) {
  399 + $param['invoices_type_id'] = $invoiceId;
405 } 400 }
  401 +
406 $param['payment_id'] = $paymentId; 402 $param['payment_id'] = $paymentId;
407 $param['payment_type'] = $paymentType; 403 $param['payment_type'] = $paymentType;
408 $param['remark'] = $remark; 404 $param['remark'] = $remark;
@@ -829,6 +829,40 @@ class HomeController extends AbstractAction @@ -829,6 +829,40 @@ class HomeController extends AbstractAction
829 //渲染模板 829 //渲染模板
830 $this->_view->display('order-content', $order); 830 $this->_view->display('order-content', $order);
831 } 831 }
  832 +
  833 + /**
  834 + * 我的订单——再次购买
  835 + */
  836 + public function reAddAction()
  837 + {
  838 + $result = array('code' => 401, 'message' => '商品加入购物车失败', 'data' => '');
  839 +
  840 + do {
  841 + /* 判断是不是AJAX请求 */
  842 + if (!$this->isAjax()) {
  843 + break;
  844 + }
  845 + //获取相关参数
  846 + $uid = $this->getUid(true);
  847 + $orderCode = $this->get('orderCode', '');
  848 + if (!$uid || !$orderCode) {
  849 + $result = array('code' => 400, 'message' => '缺失参数', 'data' => '');
  850 + break;
  851 + }
  852 + $reAddData = OrderData::reAddData($uid, $orderCode);
  853 + if(!isset($reAddData['code']) || $reAddData['code'] != 200){
  854 + break;
  855 + }
  856 + $result = array('code' => 200, 'message' => '商品已重新加入购物车', 'data' => $reAddData['data']);
  857 +
  858 + if (!isset($result['code'])) {
  859 + break;
  860 + }
  861 + }
  862 + while (false);
  863 +
  864 + $this->echoJson($result);
  865 + }
832 866
833 /* 867 /*
834 * 我的订单-取消订单 868 * 我的订单-取消订单
@@ -1022,7 +1056,6 @@ class HomeController extends AbstractAction @@ -1022,7 +1056,6 @@ class HomeController extends AbstractAction
1022 $input->SetTotal_fee($totalFee); 1056 $input->SetTotal_fee($totalFee);
1023 $input->SetTime_start(date("YmdHis", (int) $orderDetail['data']['create_time'])); 1057 $input->SetTime_start(date("YmdHis", (int) $orderDetail['data']['create_time']));
1024 $input->SetTime_expire(date("YmdHis", (int) $orderDetail['data']['create_time'] + 7200)); 1058 $input->SetTime_expire(date("YmdHis", (int) $orderDetail['data']['create_time'] + 7200));
1025 - $input->SetNotify_url(WxPayConfig::NOTIFY_URL);  
1026 $input->SetTrade_type("JSAPI"); 1059 $input->SetTrade_type("JSAPI");
1027 $input->SetOpenid($openId); 1060 $input->SetOpenid($openId);
1028 $order = WxPayApi::unifiedOrder($input); 1061 $order = WxPayApi::unifiedOrder($input);
@@ -1063,6 +1096,8 @@ class HomeController extends AbstractAction @@ -1063,6 +1096,8 @@ class HomeController extends AbstractAction
1063 1096
1064 /* 判断订单信息是否存在 */ 1097 /* 判断订单信息是否存在 */
1065 $orderDetail = OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession); 1098 $orderDetail = OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession);
  1099 +// $readd = OrderData::reAddData($this->_uid, 1611143210);
  1100 +// print_r($readd);
1066 if (empty($orderDetail)) { 1101 if (empty($orderDetail)) {
1067 $this->error(); 1102 $this->error();
1068 } 1103 }
@@ -1073,7 +1108,6 @@ class HomeController extends AbstractAction @@ -1073,7 +1108,6 @@ class HomeController extends AbstractAction
1073 1108
1074 $this->_view->display('order-detail', array( 1109 $this->_view->display('order-detail', array(
1075 'orderDetailPage' => true, 1110 'orderDetailPage' => true,
1076 - 'invoice' => empty($orderDetail['invoice']) ? array() : $orderDetail['invoice'],  
1077 'serviceUrl' => 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=', 1111 'serviceUrl' => 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409&info=',
1078 'orderDetail' => $orderDetail, 1112 'orderDetail' => $orderDetail,
1079 'orderCode' => $orderCode, 1113 'orderCode' => $orderCode,
@@ -240,37 +240,6 @@ class OrderModel @@ -240,37 +240,6 @@ class OrderModel
240 $result['isJit'] = true; 240 $result['isJit'] = true;
241 $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('orderCode' => $orderCode, 'sessionKey' => $sessionKey)); 241 $result['jitDetailUrl'] = Helpers::url('/cart/index/jitDetail', array('orderCode' => $orderCode, 'sessionKey' => $sessionKey));
242 } 242 }
243 -  
244 - $result['invoice'] = array();  
245 - //电子发票  
246 - do{  
247 - if(empty($orderDetail['data']['invoice']) || !isset($orderDetail['data']['invoice'])){  
248 - break;  
249 - }  
250 - //判断是否显示电子发票相关信息  
251 - if(isset($orderDetail['data']['invoice']['type']) == false && empty($orderDetail['data']['invoice']['type'])){  
252 - break;  
253 - }  
254 - //判断是否显示电子发票下载地址  
255 - $result['invoice'] = $orderDetail['data']['invoice'];  
256 - //纸质 1,电子 2  
257 - $result['invoice']['type'] = $result['invoice']['type'] * 1 === 2 ? true : false;//发票类型  
258 - $result['invoice']['title'] = $result['invoice']['title'];//发票抬头  
259 - $result['invoice']['contentValue'] = $result['invoice']['contentValue'];//发票内容  
260 - $result['invoice']['mobilePhone'] = $result['invoice']['mobilePhone'];//联系电话  
261 - //电子发票下载链接  
262 - if($orderDetail['data']['invoice']['showInvoice'] == true && isset($orderDetail['data']['invoice']['pdfUrl'])){  
263 - $result['invoice']['pdfUrl'] = $result['invoice']['pdfUrl'];  
264 - }  
265 - }  
266 - while(false);  
267 -// $result['invoice'] = array(  
268 -// 'type' => true,//-- 纸质 false,电子 true  
269 -// 'title' => '发票抬头',// --发票抬头  
270 -// 'contentValue' => '服饰',//-- 发票内容  
271 -// 'mobilePhone' => '13651898702',//--电话  
272 -// 'pdfUrl' => 'http://redmine.yoho.cn/attachments/download/2732/%E7%94%B5%E5%AD%90%E5%8F%91%E7%A5%A8-wap%E7%AB%AF.pdf',//--pdf下载地址  
273 -// );  
274 } 243 }
275 //取消订单原因列表 244 //取消订单原因列表
276 $resons = OrderData::closeReasons(); 245 $resons = OrderData::closeReasons();
@@ -571,11 +571,14 @@ class CartModel @@ -571,11 +571,14 @@ class CartModel
571 571
572 // 发票有关数据 572 // 发票有关数据
573 if (isset($payReturn['invoices']) && !empty($payReturn['invoices'])) { 573 if (isset($payReturn['invoices']) && !empty($payReturn['invoices'])) {
574 - foreach ($payReturn['invoices']['invoiceContentList'] as $inv) {  
575 - $result['invoice'][] = array(  
576 - 'id' => $inv['invoices_type_id'],  
577 - 'name' => $inv['invoices_type_name'],  
578 - ); 574 + $one = array();
  575 + foreach ($payReturn['invoices']['invoices_type_list'] as $inv) {
  576 + $one = array();
  577 + $one['id'] = $inv['invoices_type_id'];
  578 + $one['name'] = $inv['invoices_type_name'];
  579 + isset($orderInfo['invoiceType']) && $one['id'] == $orderInfo['invoiceType'] && $one['isSelected'] = true;
  580 +
  581 + $result['invoice'][] = $one;
579 } 582 }
580 583
581 // 发票信息需要记录 584 // 发票信息需要记录
@@ -591,11 +594,17 @@ class CartModel @@ -591,11 +594,17 @@ class CartModel
591 // 优惠券数据 594 // 优惠券数据
592 $coupons = array( 595 $coupons = array(
593 'couponName' => '', 596 'couponName' => '',
  597 + 'isCoupon' => false,
594 'count' => self::getValidCouponCount($uid) 598 'count' => self::getValidCouponCount($uid)
595 ); 599 );
596 if (isset($orderCompute['coupon_amount']) && (!empty($orderCompute['coupon_amount']) || ($orderCompute['coupon_amount'] === 0 && $orderCompute['shipping_cost'] === 0))) { 600 if (isset($orderCompute['coupon_amount']) && (!empty($orderCompute['coupon_amount']) || ($orderCompute['coupon_amount'] === 0 && $orderCompute['shipping_cost'] === 0))) {
597 $coupons['couponName'] = $orderInfo['couponName']; 601 $coupons['couponName'] = $orderInfo['couponName'];
598 } 602 }
  603 + //选中已使用的优惠劵,则剩余多少张优惠劵,不提示
  604 + if (empty($coupons['couponName']) || $coupons['count'] === 0) {
  605 + $coupons['isCoupon'] = true;
  606 + }
  607 +
599 $result['coupon'] = $coupons; 608 $result['coupon'] = $coupons;
600 } 609 }
601 while (false); 610 while (false);
@@ -736,7 +745,8 @@ class CartModel @@ -736,7 +745,8 @@ class CartModel
736 * @param int $cartType 购物车类型ID 745 * @param int $cartType 购物车类型ID
737 * @param int $deliveryTime 寄送时间ID 746 * @param int $deliveryTime 寄送时间ID
738 * @param int $deliveryWay 寄送方式ID 747 * @param int $deliveryWay 寄送方式ID
739 - * @param array $invoices 发票参数数组 748 + * @param string $invoiceTitle 发票说明
  749 + * @param int $invoiceId 发票类型ID
740 * @param int $paymentId 支付方式ID 750 * @param int $paymentId 支付方式ID
741 * @param int $paymentType 支付类型ID 751 * @param int $paymentType 支付类型ID
742 * @param string $remark 留言 752 * @param string $remark 留言
@@ -747,7 +757,7 @@ class CartModel @@ -747,7 +757,7 @@ class CartModel
747 * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 757 * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息
748 * @return array 接口返回的数据 758 * @return array 接口返回的数据
749 */ 759 */
750 - public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoices, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $skuList, $qhyUnio = '', $userAgent = null) 760 + public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $skuList, $qhyUnio = '', $userAgent = null)
751 { 761 {
752 $result = array('code' => 400, 'message' => '出错啦'); 762 $result = array('code' => 400, 'message' => '出错啦');
753 763
@@ -765,7 +775,7 @@ class CartModel @@ -765,7 +775,7 @@ class CartModel
765 $result['message'] = '请选择配送方式'; 775 $result['message'] = '请选择配送方式';
766 } 776 }
767 else { 777 else {
768 - $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoices, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $skuList, $qhyUnio, $userAgent); 778 + $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $skuList, $qhyUnio, $userAgent);
769 UdpLog::info('【结算信息】接口返回','orderSubRes'.json_encode($orderSubRes)); 779 UdpLog::info('【结算信息】接口返回','orderSubRes'.json_encode($orderSubRes));
770 if ($orderSubRes && isset($orderSubRes['code'])) { 780 if ($orderSubRes && isset($orderSubRes['code'])) {
771 $result = $orderSubRes; 781 $result = $orderSubRes;
@@ -5,8 +5,9 @@ use Hood\Core\Security\AuthCode; @@ -5,8 +5,9 @@ use Hood\Core\Security\AuthCode;
5 use Index\CartModel; 5 use Index\CartModel;
6 use Index\UserModel; 6 use Index\UserModel;
7 use Plugin\Helpers; 7 use Plugin\Helpers;
  8 +use Plugin\UnionTrans;
  9 +use Home\OrderModel;
8 use Plugin\UdpLog; 10 use Plugin\UdpLog;
9 -use LibModels\Wap\Home\UserData;  
10 11
11 /** 12 /**
12 * 购物车相关的控制器 13 * 购物车相关的控制器
@@ -301,12 +302,13 @@ class IndexController extends AbstractAction @@ -301,12 +302,13 @@ class IndexController extends AbstractAction
301 // 返回地址 302 // 返回地址
302 $returnUrl = Helpers::url('/cart/index/index'); 303 $returnUrl = Helpers::url('/cart/index/index');
303 304
304 - $cartType = $this->get('cartType', ''); 305 + $cartType = $this->get('cartType', 'ordinary');
305 $cookieData = $this->getCookie('order-info', null); 306 $cookieData = $this->getCookie('order-info', null);
306 $orderInfo = array(); 307 $orderInfo = array();
307 if (!empty($cookieData)) { 308 if (!empty($cookieData)) {
308 $orderInfo = json_decode($cookieData, true); 309 $orderInfo = json_decode($cookieData, true);
309 - $cartType = $orderInfo['cartType']; 310 + //如果为空,获取默认
  311 + $cartType = empty($orderInfo['cartType']) ? $cartType : $orderInfo['cartType'];
310 } 312 }
311 313
312 // 如果传递了code, sku,skn,buy_number就代表是限购商品 314 // 如果传递了code, sku,skn,buy_number就代表是限购商品
@@ -331,13 +333,11 @@ class IndexController extends AbstractAction @@ -331,13 +333,11 @@ class IndexController extends AbstractAction
331 $this->echoJson($order); 333 $this->echoJson($order);
332 return; 334 return;
333 } 335 }
334 - $userData = UserData::userData($uid);  
335 - $mobile = empty($userData['data']) || empty($userData['data']['mobile']) ? '' : $userData['data']['mobile']; //发票人手机 336 +
336 $data = array( 337 $data = array(
337 'orderEnsurePage' => true, 338 'orderEnsurePage' => true,
338 'isOrdinaryCart' => ($cartType !== 'advance'), 339 'isOrdinaryCart' => ($cartType !== 'advance'),
339 - 'orderEnsure' => $order,  
340 - 'userMobile' => $mobile 340 + 'orderEnsure' => $order
341 ); 341 );
342 342
343 $this->setTitle('确认订单'); 343 $this->setTitle('确认订单');
@@ -347,108 +347,6 @@ class IndexController extends AbstractAction @@ -347,108 +347,6 @@ class IndexController extends AbstractAction
347 } 347 }
348 348
349 /** 349 /**
350 - * 发票信息  
351 - */  
352 - public function invoiceInfoAction()  
353 - {  
354 - $uid = $this->getUid();  
355 - if (!$uid) {  
356 - $this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));  
357 - }  
358 - $cookieData = $this->getCookie('order-info', null); //从缓存中获取电子发票信息  
359 - $userData = UserData::userData($uid);  
360 - $userMobile = empty($userData['data']) || empty($userData['data']['mobile']) ? '' : $userData['data']['mobile']; //发票人手机  
361 - if (!empty($cookieData)) {  
362 - $orderInfo = json_decode($cookieData, true);  
363 - $invoiceType = $orderInfo['invoiceType']; //发票类型ID  
364 - $invoices_type = $orderInfo['invoicesType'] * 1; //发票类型 /**纸质 1 ,电子 2 */  
365 - $mobile = isset($orderInfo['receiverMobile']) && !empty($orderInfo['receiverMobile']) ? $orderInfo['receiverMobile'] : $userMobile; //发票人手机  
366 - $invoices_title = $orderInfo['invoiceText']; //发票抬头  
367 - $invoice_Top = $orderInfo['invoiceTitle'];  
368 - }  
369 - else {  
370 - $userData = UserData::userData($uid);  
371 - $mobile = $userMobile; //发票人手机  
372 - $invoiceType = '7'; //发票类型ID  
373 - $invoices_type = '2'; //发票类型 /**纸质 1 ,电子 2 */  
374 - $invoice_Top = '个人';  
375 - }  
376 -  
377 - $data = array(  
378 - 'invoiceInfoPage' => true,  
379 - 'invoiceNotice' => '发票须知',  
380 - 'phone' => $mobile ? substr_replace($mobile, '****', 3, 4) : '',  
381 - 'completeTel' => $mobile,  
382 - 'isCompany' => $invoice_Top =='单位' ? false : true,  
383 - 'companyName' => $invoices_title,  
384 - 'invoicesType' => array(  
385 - array(  
386 - 'id' => '2',  
387 - 'type' => '电子发票',  
388 - 'choosed' => empty($invoices_type) || $invoices_type == 2 ? true : false,  
389 - ),  
390 - array(  
391 - 'id' => '1',  
392 - 'type' => '纸质发票',  
393 - 'choosed' => $invoices_type == 1 ? true : false,  
394 - )  
395 - ),  
396 - 'invoiceTitle' => array(  
397 - array(  
398 - 'type' => '个人',  
399 - 'choosed' =>$invoice_Top == '个人'? true : false,  
400 - ),  
401 - array(  
402 - 'type' => '单位',  
403 - 'choosed' => $invoice_Top == '单位' ? true : false,  
404 - )  
405 - ),  
406 - 'content' => array(  
407 - array(  
408 - 'choosed' => empty($invoiceType) || $invoiceType == 7 ? true : false,  
409 - 'id' => 7,  
410 - 'text' => '服装'  
411 - ),  
412 - array(  
413 - 'choosed' => $invoiceType == 1 ? true : false,  
414 - 'id' => 1,  
415 - 'text' => '图书'  
416 - ),  
417 - array(  
418 - 'choosed' => $invoiceType == 9 ? true : false,  
419 - 'id' => 9,  
420 - 'text' => '配件'  
421 - ),  
422 - array(  
423 - 'choosed' => $invoiceType == 11 ? true : false,  
424 - 'id' => 11,  
425 - 'text' => '日用品'  
426 - ),  
427 - array(  
428 - 'choosed' => $invoiceType == 3 ? true : false,  
429 - 'id' => 3,  
430 - 'text' => '办公用品'  
431 - ),  
432 - array(  
433 - 'choosed' => $invoiceType == 6 ? true : false,  
434 - 'id' => 6,  
435 - 'text' => '体育用品'  
436 - ),  
437 - array(  
438 - 'choosed' => $invoiceType == 10 ? true : false,  
439 - 'id' => 10,  
440 - 'text' => '数码产品'  
441 - )  
442 - )  
443 - );  
444 -  
445 - $this->setTitle('发票信息');  
446 - $this->setNavHeader('发票信息', true, false); // 不显示右上角home按钮  
447 -  
448 - $this->_view->display('invoice-info', $data);  
449 - }  
450 -  
451 - /**  
452 * 购物车选择改变字段,重新运算订单数据 350 * 购物车选择改变字段,重新运算订单数据
453 */ 351 */
454 public function orderComputeAction() 352 public function orderComputeAction()
@@ -557,22 +455,14 @@ class IndexController extends AbstractAction @@ -557,22 +455,14 @@ class IndexController extends AbstractAction
557 $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 455 $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
558 $deliveryTime = $this->post('deliveryTimeId', 1); // 默认只工作日配送 456 $deliveryTime = $this->post('deliveryTimeId', 1); // 默认只工作日配送
559 $deliveryWay = $this->post('deliveryId', 1); // 默认普通快递 457 $deliveryWay = $this->post('deliveryId', 1); // 默认普通快递
  458 + $invoiceTitle = $this->post('invoiceText', null);
  459 + $invoiceId = $this->post('invoiceType', null);
560 $paymentId = $this->post('paymentTypeId', 15); 460 $paymentId = $this->post('paymentTypeId', 15);
561 $paymentType = $this->post('paymentType', 1); // 默认在线支付 461 $paymentType = $this->post('paymentType', 1); // 默认在线支付
562 $remark = $this->post('msg', null); 462 $remark = $this->post('msg', null);
563 $couponCode = $this->post('couponCode', null); 463 $couponCode = $this->post('couponCode', null);
564 $yohoCoin = $this->post('yohoCoin', 1); 464 $yohoCoin = $this->post('yohoCoin', 1);
565 $skuList = $this->post('skuList', ''); 465 $skuList = $this->post('skuList', '');
566 - $cookieData = $this->getCookie('order-info', null); //获取电子发票信息  
567 - //电子发票信息数组  
568 - $invoices = array();  
569 - if (!empty($cookieData)) {  
570 - $orderInfo = json_decode($cookieData, true);  
571 - $invoices['invoices_type_id'] = $orderInfo['invoiceType']; //发票类型ID  
572 - $invoices['invoices_type'] = $orderInfo['invoicesType']; //发票类型 /**纸质 1 ,电子 2 */  
573 - $invoices['receiverMobile'] = $orderInfo['receiverMobile']; //发票人手机  
574 - $invoices['invoices_title'] = empty($orderInfo['invoiceText']) ? '个人' : $orderInfo['invoiceText']; //发票抬头  
575 - }  
576 466
577 /* 判断是否是友盟过来的用户 */ 467 /* 判断是否是友盟过来的用户 */
578 $userAgent = null; 468 $userAgent = null;
@@ -585,14 +475,16 @@ class IndexController extends AbstractAction @@ -585,14 +475,16 @@ class IndexController extends AbstractAction
585 /* 模拟APP的User-Agent */ 475 /* 模拟APP的User-Agent */
586 $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null; 476 $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null;
587 } 477 }
588 - $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoices, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $skuList, $unionKey, $userAgent); 478 +
  479 + $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $skuList, $unionKey, $userAgent);
589 480
590 // 记录下单异常的数据 481 // 记录下单异常的数据
591 if (empty($result)) { 482 if (empty($result)) {
592 $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime 483 $message = 'uid:' . $uid . ',addressId:' . $addressId . ',cartType:' . $cartType . ',deliveryTime:' . $deliveryTime
593 - . ',deliveryWay:' . $deliveryWay . ',yohoCoin:' . $yohoCoin 484 + . ',deliveryWay:' . $deliveryWay . 'invoiceTitle:' . $invoiceTitle . ',invoiceId:' . $invoiceId . ',yohoCoin:' . $yohoCoin
594 . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n"; 485 . ',paymentId:' . $paymentId . ',paymentType:' . $paymentType . ',remark:' . $remark . ',couponCode:' . $couponCode . "\n";
595 - UdpLog::info('【下单】下单异常数据', 'message:' . $message, '返回:' . json_encode($result)); 486 + error_log($message, 3, '/Data/logs/php/h5_error/order.' . date('Ym') . '.log');
  487 + UdpLog::info('【下单】下单异常数据','message:'.$message,'返回:'.json_encode($result));
596 } 488 }
597 // 返回数据 489 // 返回数据
598 else { 490 else {
@@ -601,6 +493,14 @@ class IndexController extends AbstractAction @@ -601,6 +493,14 @@ class IndexController extends AbstractAction
601 493
602 $this->echoJson($result); 494 $this->echoJson($result);
603 } 495 }
  496 +
  497 + /* if ($uid && !empty($result['data'])) {
  498 + try {
  499 + UnionTrans::set($uid, $result['data']['order_code'], $result['data']['order_amount']);
  500 + } catch (Exception $e) {
  501 + // do nothing
  502 + }
  503 + } */
604 } 504 }
605 else { 505 else {
606 echo ' '; 506 echo ' ';