Authored by 周少峰

invoice

@@ -360,8 +360,10 @@ class CartData @@ -360,8 +360,10 @@ class CartData
360 * @param string $cartType 购物车类型 360 * @param string $cartType 购物车类型
361 * @param int $deliveryTime 寄送时间ID 361 * @param int $deliveryTime 寄送时间ID
362 * @param int $deliveryWay 寄送方式ID 362 * @param int $deliveryWay 寄送方式ID
363 - * @param string $invoiceTitle 发票说明  
364 - * @param int $invoiceId 发票类型ID 363 + * @param int $invoiceType 发票类型 1:纸质,2:电子
  364 + * @param string $invoiceTitle 发票抬头
  365 + * @param int $invoiceContent 发票内容
  366 + * @param string $receiverMobile 发票接收人电话
365 * @param int $paymentId 支付方式ID 367 * @param int $paymentId 支付方式ID
366 * @param int $paymentType 支付类型ID 368 * @param int $paymentType 支付类型ID
367 * @param string $remark 留言 369 * @param string $remark 留言
@@ -375,7 +377,7 @@ class CartData @@ -375,7 +377,7 @@ class CartData
375 * @param int $redEnvelopes 红包 377 * @param int $redEnvelopes 红包
376 * @return array 接口返回的数据 378 * @return array 接口返回的数据
377 */ 379 */
378 - public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $invoiceId, 380 + public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
379 $paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes) 381 $paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
380 { 382 {
381 $param = Yohobuy::param(); 383 $param = Yohobuy::param();
@@ -390,13 +392,13 @@ class CartData @@ -390,13 +392,13 @@ class CartData
390 $param['uid'] = $uid; 392 $param['uid'] = $uid;
391 393
392 if (!empty($invoiceType)) { 394 if (!empty($invoiceType)) {
393 - $param['invoices_type'] = $invoiceTitle; 395 + $param['invoices_type'] = $invoiceType;
394 } 396 }
395 if (!empty($invoiceTitle)) { 397 if (!empty($invoiceTitle)) {
396 $param['invoices_title'] = $invoiceTitle; 398 $param['invoices_title'] = $invoiceTitle;
397 } 399 }
398 if (!empty($invoiceContent)) { 400 if (!empty($invoiceContent)) {
399 - $param['invoices_type'] = $invoiceContent; 401 + $param['invoice_content'] = $invoiceContent;
400 } 402 }
401 if (!empty($receiverMobile)) { 403 if (!empty($receiverMobile)) {
402 $param['receiverMobile'] = $receiverMobile; 404 $param['receiverMobile'] = $receiverMobile;
@@ -41,7 +41,8 @@ class OrderData @@ -41,7 +41,8 @@ class OrderData
41 $param['uid'] = $uid; 41 $param['uid'] = $uid;
42 $param['order_code'] = $orderCode; 42 $param['order_code'] = $orderCode;
43 $param['client_secret'] = Sign::getSign($param); 43 $param['client_secret'] = Sign::getSign($param);
44 - return Yohobuy::get(Yohobuy::API_URL, $param); 44 +// return Yohobuy::get(Yohobuy::API_URL, $param);
  45 + return Yohobuy::get('http://devapi.yoho.cn:58078', $param);
45 } 46 }
46 47
47 /** 48 /**
@@ -439,9 +439,9 @@ class IndexController extends WebAction @@ -439,9 +439,9 @@ 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('invoicesType', null); // 发票类型:纸质 1 ,电子 2 442 + $invoiceType = $this->post('invoiceType', null); // 发票类型:纸质 1 ,电子 2
443 $invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头 443 $invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头
444 - $invoiceContent = $this->post('invoiceContent ', null); // 发票内容 444 + $invoiceContent = $this->post('invoiceContent', null); // 发票内容
445 $receiverMobile = $this->post('receiverMobile', null); // 接收人电话 445 $receiverMobile = $this->post('receiverMobile', null); // 接收人电话
446 446
447 $paymentId = $this->post('paymentId', 15); // 支付ID 447 $paymentId = $this->post('paymentId', 15); // 支付ID
@@ -453,9 +453,8 @@ class IndexController extends WebAction @@ -453,9 +453,8 @@ class IndexController extends WebAction
453 $isPreContact = $this->post('isPreContact', false); // 送货前是否联系 453 $isPreContact = $this->post('isPreContact', false); // 送货前是否联系
454 $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格 454 $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格
455 $redEnvelopes = $this->post('redEnvelopes', null); 455 $redEnvelopes = $this->post('redEnvelopes', null);
456 -  
457 // 调用下单接口 456 // 调用下单接口
458 - $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, 457 + $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
459 $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); 458 $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
460 // 判断是否下单成功 459 // 判断是否下单成功
461 if (empty($result['data']['order_code'])) { 460 if (empty($result['data']['order_code'])) {
@@ -112,6 +112,12 @@ class OrdersController extends WebAction @@ -112,6 +112,12 @@ 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['pdfUrl'],
  119 + 'title' => $detail['title'],
  120 + 'contentValue' => $detail['contentValue'] ? $detail['contentValue'] : '个人',
115 ); 121 );
116 if (isset($detail['noramlPayMode'])) { 122 if (isset($detail['noramlPayMode'])) {
117 $data['orderInfo'] = $detail['orderInfo']; 123 $data['orderInfo'] = $detail['orderInfo'];