Authored by 周少峰

remove invoice

... ... @@ -359,10 +359,8 @@ class CartData
* @param string $cartType 购物车类型
* @param int $deliveryTime 寄送时间ID
* @param int $deliveryWay 寄送方式ID
* @param int $invoiceType 发票类型 1:纸质,2:电子
* @param string $invoiceTitle 发票抬头
* @param int $invoiceContent 发票内容
* @param string $receiverMobile 发票接收人电话
* @param string $invoiceTitle 发票说明
* @param int $invoiceId 发票类型ID
* @param int $paymentId 支付方式ID
* @param int $paymentType 支付类型ID
* @param string $remark 留言
... ... @@ -376,7 +374,7 @@ class CartData
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId,
$paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
{
$param = Yohobuy::param();
... ... @@ -389,18 +387,11 @@ class CartData
$param['delivery_time'] = $deliveryTime;
$param['delivery_way'] = $deliveryWay;
$param['uid'] = $uid;
if (!empty($invoiceType)) {
$param['invoices_type'] = $invoiceType;
}
if (!empty($invoiceTitle)) {
$param['invoices_title'] = $invoiceTitle;
}
if (!empty($invoiceContent)) {
$param['invoice_content'] = $invoiceContent;
}
if (!empty($receiverMobile)) {
$param['receiverMobile'] = $receiverMobile;
if (!empty($invoiceId)) {
$param['invoices_type_id'] = $invoiceId;
}
if (!empty($redEnvelopes)) {
$param['use_red_envelopes'] = $redEnvelopes;
... ... @@ -429,6 +420,7 @@ class CartData
}
$param['remark'] = $remark;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param, false, false, 10, $userAgent);
}
... ...
... ... @@ -225,16 +225,6 @@ 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['showInvoice'] = $orderDetail['invoice']['showInvoice'];
}
$detail['yoho_give_coin'] = $orderDetail['yoho_give_coin'];
$detail['yohoCoinUrl'] = Helpers::url('/help', array('category_id' => 87)); //什么是yoho币介绍
$detail['remark'] = $orderDetail['remark'];
... ...
... ... @@ -579,9 +579,6 @@ class CartModel
do {
/* 调接口订单确认接口 */
$pay = CartData::cartPay($uid, $cartType);
//获取用户手机号码用于发票接收人
$userInfo = UserData::getUserInfo($uid);
if (!$pay || empty($pay['data']['goods_list'])) {
break;
}
... ... @@ -698,14 +695,14 @@ class CartModel
}
}
/* 发票内容 */
if (!empty($pay['data']['invoices']['invoiceContentList'])) {
foreach ($pay['data']['invoices']['invoiceContentList'] as $value) {
$result['piaoTypes'][$value['invoices_type_id']]['id'] = $value['invoices_type_id'];
$result['piaoTypes'][$value['invoices_type_id']]['name'] = $value['invoices_type_name'];
/* 发票类型 */
if (!empty($pay['data']['invoices']['invoices_type_list'])) {
$build = array();
foreach ($pay['data']['invoices']['invoices_type_list'] as $value) {
$build['id'] = $value['invoices_type_id'];
$build['name'] = $value['invoices_type_name'];
$result['piaoTypes'][] = $build;
}
$result['receiverMobile'] = isset($userInfo['data']['mobile']) && $userInfo['data']['mobile'] ? $userInfo['data']['mobile'] : '';
$result['invoiceUrl'] = 'http://www.yohobuy.com/help?category_id=99';
}
/* 需购买的商品 */
... ... @@ -898,7 +895,7 @@ class CartModel
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes)
public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes)
{
$result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE);
... ... @@ -939,7 +936,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, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes);
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes);
if ($orderSubRes && isset($orderSubRes['code'])) {
$result = $orderSubRes;
}
... ...
... ... @@ -439,11 +439,8 @@ class IndexController extends WebAction
$cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
$deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送
$deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递
$invoiceType = $this->post('invoiceType', null); // 发票类型:纸质 1 ,电子 2
$invoiceTitle = $this->post('invoiceTitle', '个人'); // 发票抬头
$invoiceContent = $this->post('invoiceContent', null); // 发票内容
$receiverMobile = $this->post('receiverMobile', null); // 接收人电话
$invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头
$invoiceId = $this->post('invoiceId', null); // 发票类型
$paymentId = $this->post('paymentId', 15); // 支付ID
$paymentType = $this->post('paymentType', 1); // 默认在线支付
$remark = $this->post('remark', ''); // 备注信息
... ... @@ -453,8 +450,9 @@ 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, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile,
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId,
$paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
// 判断是否下单成功
if (empty($result['data']['order_code'])) {
... ...
... ... @@ -112,12 +112,6 @@ 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['showInvoice'] && $detail['pdfUrl'] ? $detail['pdfUrl'] : '',
'title' => $detail['title'],
'contentValue' => $detail['contentValue'] ? $detail['contentValue'] : '个人',
);
if (isset($detail['noramlPayMode'])) {
$data['orderInfo'] = $detail['orderInfo'];
... ...