|
@@ -101,10 +101,10 @@ class ReadOauth
|
|
|
}
|
|
|
return redirect()->to($redirect);
|
|
|
}
|
|
|
-
|
|
|
+ $uri_send_order_id = 0;
|
|
|
if (strpos($uri, '/yun/') !== false) {
|
|
|
$uri_send_order_id = (int)str_ireplace('/yun/', '', $uri);
|
|
|
- Redis::hset('book_read:' . $uid_cookie, 'send_order_id', $uri_send_order_id);
|
|
|
+ //Redis::hset('book_read:' . $uid_cookie, 'send_order_id', $uri_send_order_id);
|
|
|
}
|
|
|
|
|
|
//个性化推送
|
|
@@ -125,7 +125,7 @@ class ReadOauth
|
|
|
Log::info($user_info);*/
|
|
|
$back = $request->get('back', '');
|
|
|
if ($openid && $appid && $distribution_channel_id && $uid_cookie) {
|
|
|
- $this->apidAndOpenId($distribution_channel_id, $appid, $openid, $uid_cookie);
|
|
|
+ $this->apidAndOpenId($distribution_channel_id, $appid, $openid, $uid_cookie,$uri_send_order_id);
|
|
|
$channel = ChannelService::getById($distribution_channel_id);
|
|
|
$is_yq_move = $this->isQyMove($channel, $distribution_channel_id);
|
|
|
if ($is_yq_move) {
|
|
@@ -327,7 +327,7 @@ class ReadOauth
|
|
|
return $arg;
|
|
|
}
|
|
|
|
|
|
- private function apidAndOpenId($distribution_channel_id, $appid, $openid, $uid)
|
|
|
+ private function apidAndOpenId($distribution_channel_id, $appid, $openid, $uid,$send_order_id)
|
|
|
{
|
|
|
$appid_info = OfficialAccountService::officialAccountByAppid(['appid' => $appid]);
|
|
|
if (!$appid_info)
|
|
@@ -339,19 +339,19 @@ class ReadOauth
|
|
|
$res = ForceSubscribeService::forceSubscribeUsersByUidAndAppid($appid, $uid);
|
|
|
if ($res) return false;
|
|
|
|
|
|
- /*$forcesubuser = ForceSubscribeService::forceSubscribeUsersByOpenid(['openid' => $openid]);
|
|
|
+ $forcesubuser = ForceSubscribeService::forceSubscribeUsersByOpenid(['openid' => $openid]);
|
|
|
if ($forcesubuser) {
|
|
|
return false;
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
- $send_order_id = ReadRecordService::getSendOrderId($uid);
|
|
|
+ /*$send_order_id = ReadRecordService::getSendOrderId($uid);
|
|
|
if ($send_order_id) {
|
|
|
try {
|
|
|
Redis::hset('force_subscribe_from_send_order_id', $appid . '_' . $uid, $send_order_id);
|
|
|
} catch (\Exception $e) {
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ }*/
|
|
|
$user_info = ForceSubscribeService::getUserInfoAll($appid, $openid);
|
|
|
$forcesubuserdata = [
|
|
|
'appid' => $appid,
|
|
@@ -361,6 +361,9 @@ class ReadOauth
|
|
|
'openid' => $openid,
|
|
|
'official_account_id' => 1
|
|
|
];
|
|
|
+ if($send_order_id){
|
|
|
+ $forcesubuserdata['send_order_id'] = $send_order_id;
|
|
|
+ }
|
|
|
if ($user_info) {
|
|
|
isset($user_info['province']) && !empty($user_info['province']) && $forcesubuserdata['province'] = $user_info['province'];
|
|
|
isset($user_info['nickname']) && !empty($user_info['nickname']) && $forcesubuserdata['nickname'] = $user_info['nickname'];
|