Authored by Rock Zhang

Merge branch 'ymhotfix'

... ... @@ -348,12 +348,13 @@ class CartData
* @param mixed $yohoCoin 使用的YOHO币数量或为空
* @param int $isPreContact 送货前是否联系
* @param int $isPrintPrice 是否打印价格
* @param string $unionKey 联盟Key
* @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId,
$paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $isPreContact, $isPrintPrice, $userAgent, $redEnvelopes)
$paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes)
{
$param = Yohobuy::param();
$param['debug'] = 'Y';
... ... @@ -388,6 +389,10 @@ class CartData
if (!empty($isPrintPrice) && $isPrintPrice == 'true') {
$param['is_print_price'] = 'Y';
}
// 友盟有关信息的传递
if (!empty($unionKey)) {
$param['qhy_union'] = $unionKey;
}
$param['remark'] = $remark;
$param['client_secret'] = Sign::getSign($param);
... ...
... ... @@ -855,6 +855,7 @@ class CartModel
/* 判断是否是友盟过来的用户 */
$userAgent = null;
$unionKey = '';
if (!empty($_COOKIE['_QYH_UNION'])) {
/* 解密客户端联盟信息 */
$unionKey = AuthCode::decode($_COOKIE['_QYH_UNION'], 'q_union_yohobuy');
... ... @@ -864,7 +865,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, $yohoCoin, $isPreContact, $isPrintPrice, $userAgent, $redEnvelopes);
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes);
if ($orderSubRes && isset($orderSubRes['code'])) {
$result = $orderSubRes;
}
... ...