Authored by 周少峰

invoice

... ... @@ -360,8 +360,10 @@ class CartData
* @param string $cartType 购物车类型
* @param int $deliveryTime 寄送时间ID
* @param int $deliveryWay 寄送方式ID
* @param string $invoiceTitle 发票说明
* @param int $invoiceId 发票类型ID
* @param int $invoiceType 发票类型 1:纸质,2:电子
* @param string $invoiceTitle 发票抬头
* @param int $invoiceContent 发票内容
* @param string $receiverMobile 发票接收人电话
* @param int $paymentId 支付方式ID
* @param int $paymentType 支付类型ID
* @param string $remark 留言
... ... @@ -375,7 +377,7 @@ class CartData
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $invoiceId,
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
$paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
{
$param = Yohobuy::param();
... ... @@ -390,13 +392,13 @@ class CartData
$param['uid'] = $uid;
if (!empty($invoiceType)) {
$param['invoices_type'] = $invoiceTitle;
$param['invoices_type'] = $invoiceType;
}
if (!empty($invoiceTitle)) {
$param['invoices_title'] = $invoiceTitle;
}
if (!empty($invoiceContent)) {
$param['invoices_type'] = $invoiceContent;
$param['invoice_content'] = $invoiceContent;
}
if (!empty($receiverMobile)) {
$param['receiverMobile'] = $receiverMobile;
... ...
... ... @@ -41,7 +41,8 @@ class OrderData
$param['uid'] = $uid;
$param['order_code'] = $orderCode;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
// return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get('http://devapi.yoho.cn:58078', $param);
}
/**
... ...
... ... @@ -439,9 +439,9 @@ class IndexController extends WebAction
$cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
$deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送
$deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递
$invoiceType = $this->post('invoicesType', null); // 发票类型:纸质 1 ,电子 2
$invoiceType = $this->post('invoiceType', null); // 发票类型:纸质 1 ,电子 2
$invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头
$invoiceContent = $this->post('invoiceContent ', null); // 发票内容
$invoiceContent = $this->post('invoiceContent', null); // 发票内容
$receiverMobile = $this->post('receiverMobile', null); // 接收人电话
$paymentId = $this->post('paymentId', 15); // 支付ID
... ... @@ -453,9 +453,8 @@ class IndexController extends WebAction
$isPreContact = $this->post('isPreContact', false); // 送货前是否联系
$isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格
$redEnvelopes = $this->post('redEnvelopes', null);
// 调用下单接口
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId,
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
$paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
// 判断是否下单成功
if (empty($result['data']['order_code'])) {
... ...
... ... @@ -112,6 +112,12 @@ class OrdersController extends WebAction
'orderBalance' => isset($detail['orderBalance']) ? $detail['orderBalance'] : array(),
'operation' => $detail['operation'],
'totalYoho' => $detail['yoho_give_coin'],
//发票信息
'invoiceMode' => $detail['invoiceMode'],
'invoiceType' => $detail['invoiceType'] === 2 ? '电子发票' : '纸质发票',
'pdfUrl' => $detail['pdfUrl'],
'title' => $detail['title'],
'contentValue' => $detail['contentValue'] ? $detail['contentValue'] : '个人',
);
if (isset($detail['noramlPayMode'])) {
$data['orderInfo'] = $detail['orderInfo'];
... ...