...
|
...
|
@@ -1062,15 +1062,19 @@ class CartModel |
|
|
/* 判断是否是友盟过来的用户 */
|
|
|
$userAgent = null;
|
|
|
$unionKey = '';
|
|
|
if (!empty($_COOKIE['_QYH_UNION'])) {
|
|
|
// 新平台统一来源
|
|
|
$unionKey = trim(Encryption::decrypt(urldecode($_COOKIE['_QYH_UNION'])));
|
|
|
$extraIndex = strrpos($unionKey, '}') + 1;
|
|
|
$unionKey = $encryObject = substr($unionKey, 0, $extraIndex);
|
|
|
$unionClient = json_decode($encryObject, true);
|
|
|
if (!isset($unionClient['client_id']) || empty($unionClient['client_id'])) {
|
|
|
/* 解密客户端联盟信息(老逻辑) */
|
|
|
$unionKey = AuthCode::decode($_COOKIE['_QYH_UNION'], 'q_union_yohobuy');
|
|
|
if (!empty($_COOKIE['mkt_code']) || !empty($_COOKIE['_QYH_UNION'])) {
|
|
|
if (!empty($_COOKIE['mkt_code'])) {
|
|
|
$unionKey = '{"client_id":' . (strlen($_COOKIE['mkt_code']) >= 15 ? '' : '800') . $_COOKIE['mkt_code'] . '}';
|
|
|
} else {
|
|
|
// 新平台统一来源
|
|
|
$unionKey = trim(Encryption::decrypt(urldecode($_COOKIE['_QYH_UNION'])));
|
|
|
$extraIndex = strrpos($unionKey, '}') + 1;
|
|
|
$unionKey = $encryObject = substr($unionKey, 0, $extraIndex);
|
|
|
$unionClient = json_decode($encryObject, true);
|
|
|
if (!isset($unionClient['client_id']) || empty($unionClient['client_id'])) {
|
|
|
/* 解密客户端联盟信息(老逻辑) */
|
|
|
$unionKey = AuthCode::decode($_COOKIE['_QYH_UNION'], 'q_union_yohobuy');
|
|
|
}
|
|
|
}
|
|
|
/* 检查联盟参数是否有效 */
|
|
|
$unionInfo = empty($unionKey) ? array() : json_decode($unionKey, true);
|
...
|
...
|
|