Authored by 周少峰

invoice

... ... @@ -374,7 +374,7 @@ class CartData
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId,
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $invoiceId,
$paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
{
$param = Yohobuy::param();
... ... @@ -387,11 +387,18 @@ class CartData
$param['delivery_time'] = $deliveryTime;
$param['delivery_way'] = $deliveryWay;
$param['uid'] = $uid;
if (!empty($invoiceType)) {
$param['invoices_type'] = $invoiceTitle;
}
if (!empty($invoiceTitle)) {
$param['invoices_title'] = $invoiceTitle;
}
if (!empty($invoiceId)) {
$param['invoices_type_id'] = $invoiceId;
if (!empty($invoiceContent)) {
$param['invoices_type'] = $invoiceContent;
}
if (!empty($receiverMobile)) {
$param['receiverMobile'] = $receiverMobile;
}
if (!empty($redEnvelopes)) {
$param['use_red_envelopes'] = $redEnvelopes;
... ...
... ... @@ -219,6 +219,15 @@ class OrderModel
}
$detail['orderBalance'][] = array('promotion' => '实际应支付', 'account' => $orderDetail['amount']);
}
//发票
if (isset($orderDetail['invoice']) && $orderDetail['invoice']) {
$detail['invoiceMode'] = true;
$detail['invoiceType'] = $orderDetail['invoice']['type'];
$detail['pdfUrl'] = $orderDetail['invoice']['pdfUrl'];
$detail['title'] = $orderDetail['invoice']['title'];
$detail['contentValue'] = $orderDetail['invoice']['contentValue'];
}
$detail['yoho_give_coin'] = $orderDetail['yoho_give_coin'];
$detail['yohoCoinUrl'] = Helpers::url('/help', array('category_id' => 87)); //什么是yoho币介绍
$detail['remark'] = $orderDetail['remark'];
... ...
... ... @@ -703,6 +703,7 @@ class CartModel
$build['name'] = $value['invoices_type_name'];
$result['piaoTypes'][] = $build;
}
$result['receiverMobile '] = isset($pay['data']['delivery_address']['mobile']) ? $pay['data']['delivery_address']['mobile'] : '';
}
/* 需购买的商品 */
... ... @@ -895,7 +896,7 @@ class CartModel
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes)
public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes)
{
$result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE);
... ... @@ -936,7 +937,7 @@ class CartModel
$userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null;
}
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes);
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes);
if ($orderSubRes && isset($orderSubRes['code'])) {
$result = $orderSubRes;
}
... ...
... ... @@ -439,8 +439,11 @@ 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
$invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头
$invoiceId = $this->post('invoiceId', null); // 发票类型
$invoiceContent = $this->post('invoiceContent ', null); // 发票内容
$receiverMobile = $this->post('receiverMobile', null); // 接收人电话
$paymentId = $this->post('paymentId', 15); // 支付ID
$paymentType = $this->post('paymentType', 1); // 默认在线支付
$remark = $this->post('remark', ''); // 备注信息
... ...