Authored by 周少峰

remove invoice

@@ -359,10 +359,8 @@ class CartData @@ -359,10 +359,8 @@ class CartData
359 * @param string $cartType 购物车类型 359 * @param string $cartType 购物车类型
360 * @param int $deliveryTime 寄送时间ID 360 * @param int $deliveryTime 寄送时间ID
361 * @param int $deliveryWay 寄送方式ID 361 * @param int $deliveryWay 寄送方式ID
362 - * @param int $invoiceType 发票类型 1:纸质,2:电子  
363 - * @param string $invoiceTitle 发票抬头  
364 - * @param int $invoiceContent 发票内容  
365 - * @param string $receiverMobile 发票接收人电话 362 + * @param string $invoiceTitle 发票说明
  363 + * @param int $invoiceId 发票类型ID
366 * @param int $paymentId 支付方式ID 364 * @param int $paymentId 支付方式ID
367 * @param int $paymentType 支付类型ID 365 * @param int $paymentType 支付类型ID
368 * @param string $remark 留言 366 * @param string $remark 留言
@@ -376,7 +374,7 @@ class CartData @@ -376,7 +374,7 @@ class CartData
376 * @param int $redEnvelopes 红包 374 * @param int $redEnvelopes 红包
377 * @return array 接口返回的数据 375 * @return array 接口返回的数据
378 */ 376 */
379 - public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, 377 + public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId,
380 $paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes) 378 $paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
381 { 379 {
382 $param = Yohobuy::param(); 380 $param = Yohobuy::param();
@@ -389,18 +387,11 @@ class CartData @@ -389,18 +387,11 @@ class CartData
389 $param['delivery_time'] = $deliveryTime; 387 $param['delivery_time'] = $deliveryTime;
390 $param['delivery_way'] = $deliveryWay; 388 $param['delivery_way'] = $deliveryWay;
391 $param['uid'] = $uid; 389 $param['uid'] = $uid;
392 -  
393 - if (!empty($invoiceType)) {  
394 - $param['invoices_type'] = $invoiceType;  
395 - }  
396 if (!empty($invoiceTitle)) { 390 if (!empty($invoiceTitle)) {
397 $param['invoices_title'] = $invoiceTitle; 391 $param['invoices_title'] = $invoiceTitle;
398 } 392 }
399 - if (!empty($invoiceContent)) {  
400 - $param['invoice_content'] = $invoiceContent;  
401 - }  
402 - if (!empty($receiverMobile)) {  
403 - $param['receiverMobile'] = $receiverMobile; 393 + if (!empty($invoiceId)) {
  394 + $param['invoices_type_id'] = $invoiceId;
404 } 395 }
405 if (!empty($redEnvelopes)) { 396 if (!empty($redEnvelopes)) {
406 $param['use_red_envelopes'] = $redEnvelopes; 397 $param['use_red_envelopes'] = $redEnvelopes;
@@ -429,6 +420,7 @@ class CartData @@ -429,6 +420,7 @@ class CartData
429 } 420 }
430 $param['remark'] = $remark; 421 $param['remark'] = $remark;
431 $param['client_secret'] = Sign::getSign($param); 422 $param['client_secret'] = Sign::getSign($param);
  423 +
432 return Yohobuy::get(Yohobuy::API_URL, $param, false, false, 10, $userAgent); 424 return Yohobuy::get(Yohobuy::API_URL, $param, false, false, 10, $userAgent);
433 } 425 }
434 426
@@ -225,16 +225,6 @@ class OrderModel @@ -225,16 +225,6 @@ class OrderModel
225 } 225 }
226 $detail['orderBalance'][] = array('promotion' => '实际应支付', 'account' => $orderDetail['amount']); 226 $detail['orderBalance'][] = array('promotion' => '实际应支付', 'account' => $orderDetail['amount']);
227 } 227 }
228 - //发票  
229 - if (isset($orderDetail['invoice']) && $orderDetail['invoice']) {  
230 - $detail['invoiceMode'] = true;  
231 - $detail['invoiceType'] = $orderDetail['invoice']['type'];  
232 - $detail['pdfUrl'] = $orderDetail['invoice']['pdfUrl'];  
233 - $detail['title'] = $orderDetail['invoice']['title'];  
234 - $detail['contentValue'] = $orderDetail['invoice']['contentValue'];  
235 - $detail['showInvoice'] = $orderDetail['invoice']['showInvoice'];  
236 - }  
237 -  
238 $detail['yoho_give_coin'] = $orderDetail['yoho_give_coin']; 228 $detail['yoho_give_coin'] = $orderDetail['yoho_give_coin'];
239 $detail['yohoCoinUrl'] = Helpers::url('/help', array('category_id' => 87)); //什么是yoho币介绍 229 $detail['yohoCoinUrl'] = Helpers::url('/help', array('category_id' => 87)); //什么是yoho币介绍
240 $detail['remark'] = $orderDetail['remark']; 230 $detail['remark'] = $orderDetail['remark'];
@@ -579,9 +579,6 @@ class CartModel @@ -579,9 +579,6 @@ class CartModel
579 do { 579 do {
580 /* 调接口订单确认接口 */ 580 /* 调接口订单确认接口 */
581 $pay = CartData::cartPay($uid, $cartType); 581 $pay = CartData::cartPay($uid, $cartType);
582 - //获取用户手机号码用于发票接收人  
583 - $userInfo = UserData::getUserInfo($uid);  
584 -  
585 if (!$pay || empty($pay['data']['goods_list'])) { 582 if (!$pay || empty($pay['data']['goods_list'])) {
586 break; 583 break;
587 } 584 }
@@ -698,14 +695,14 @@ class CartModel @@ -698,14 +695,14 @@ class CartModel
698 } 695 }
699 } 696 }
700 697
701 - /* 发票内容 */  
702 - if (!empty($pay['data']['invoices']['invoiceContentList'])) {  
703 - foreach ($pay['data']['invoices']['invoiceContentList'] as $value) {  
704 - $result['piaoTypes'][$value['invoices_type_id']]['id'] = $value['invoices_type_id'];  
705 - $result['piaoTypes'][$value['invoices_type_id']]['name'] = $value['invoices_type_name']; 698 + /* 发票类型 */
  699 + if (!empty($pay['data']['invoices']['invoices_type_list'])) {
  700 + $build = array();
  701 + foreach ($pay['data']['invoices']['invoices_type_list'] as $value) {
  702 + $build['id'] = $value['invoices_type_id'];
  703 + $build['name'] = $value['invoices_type_name'];
  704 + $result['piaoTypes'][] = $build;
706 } 705 }
707 - $result['receiverMobile'] = isset($userInfo['data']['mobile']) && $userInfo['data']['mobile'] ? $userInfo['data']['mobile'] : '';  
708 - $result['invoiceUrl'] = 'http://www.yohobuy.com/help?category_id=99';  
709 } 706 }
710 707
711 /* 需购买的商品 */ 708 /* 需购买的商品 */
@@ -898,7 +895,7 @@ class CartModel @@ -898,7 +895,7 @@ class CartModel
898 * @param int $redEnvelopes 红包 895 * @param int $redEnvelopes 红包
899 * @return array 接口返回的数据 896 * @return array 接口返回的数据
900 */ 897 */
901 - public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes) 898 + public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes)
902 { 899 {
903 $result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE); 900 $result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE);
904 901
@@ -939,7 +936,7 @@ class CartModel @@ -939,7 +936,7 @@ class CartModel
939 $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null; 936 $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null;
940 } 937 }
941 938
942 - $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes); 939 + $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes);
943 if ($orderSubRes && isset($orderSubRes['code'])) { 940 if ($orderSubRes && isset($orderSubRes['code'])) {
944 $result = $orderSubRes; 941 $result = $orderSubRes;
945 } 942 }
@@ -439,11 +439,8 @@ class IndexController extends WebAction @@ -439,11 +439,8 @@ class IndexController extends WebAction
439 $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 439 $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
440 $deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送 440 $deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送
441 $deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递 441 $deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递
442 - $invoiceType = $this->post('invoiceType', null); // 发票类型:纸质 1 ,电子 2  
443 - $invoiceTitle = $this->post('invoiceTitle', '个人'); // 发票抬头  
444 - $invoiceContent = $this->post('invoiceContent', null); // 发票内容  
445 - $receiverMobile = $this->post('receiverMobile', null); // 接收人电话  
446 - 442 + $invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头
  443 + $invoiceId = $this->post('invoiceId', null); // 发票类型
447 $paymentId = $this->post('paymentId', 15); // 支付ID 444 $paymentId = $this->post('paymentId', 15); // 支付ID
448 $paymentType = $this->post('paymentType', 1); // 默认在线支付 445 $paymentType = $this->post('paymentType', 1); // 默认在线支付
449 $remark = $this->post('remark', ''); // 备注信息 446 $remark = $this->post('remark', ''); // 备注信息
@@ -453,8 +450,9 @@ class IndexController extends WebAction @@ -453,8 +450,9 @@ class IndexController extends WebAction
453 $isPreContact = $this->post('isPreContact', false); // 送货前是否联系 450 $isPreContact = $this->post('isPreContact', false); // 送货前是否联系
454 $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格 451 $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格
455 $redEnvelopes = $this->post('redEnvelopes', null); 452 $redEnvelopes = $this->post('redEnvelopes', null);
  453 +
456 // 调用下单接口 454 // 调用下单接口
457 - $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, 455 + $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId,
458 $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); 456 $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
459 // 判断是否下单成功 457 // 判断是否下单成功
460 if (empty($result['data']['order_code'])) { 458 if (empty($result['data']['order_code'])) {
@@ -112,12 +112,6 @@ class OrdersController extends WebAction @@ -112,12 +112,6 @@ class OrdersController extends WebAction
112 'orderBalance' => isset($detail['orderBalance']) ? $detail['orderBalance'] : array(), 112 'orderBalance' => isset($detail['orderBalance']) ? $detail['orderBalance'] : array(),
113 'operation' => $detail['operation'], 113 'operation' => $detail['operation'],
114 'totalYoho' => $detail['yoho_give_coin'], 114 'totalYoho' => $detail['yoho_give_coin'],
115 - //发票信息  
116 - 'invoiceMode' => $detail['invoiceMode'],  
117 - 'invoiceType' => $detail['invoiceType'] === 2 ? '电子发票' : '纸质发票',  
118 - 'pdfUrl' => $detail['showInvoice'] && $detail['pdfUrl'] ? $detail['pdfUrl'] : '',  
119 - 'title' => $detail['title'],  
120 - 'contentValue' => $detail['contentValue'] ? $detail['contentValue'] : '个人',  
121 ); 115 );
122 if (isset($detail['noramlPayMode'])) { 116 if (isset($detail['noramlPayMode'])) {
123 $data['orderInfo'] = $detail['orderInfo']; 117 $data['orderInfo'] = $detail['orderInfo'];