|
@@ -10,6 +10,7 @@ use App\Modules\User\Models\YqMove;
|
|
|
use App\Modules\User\Services\ReadRecordService;
|
|
|
use App\Modules\User\Services\UserService;
|
|
|
use App\Modules\YunQi\Services\BookUserService;
|
|
|
+use App\Modules\YunQi\Services\YqUserBidRelationService;
|
|
|
use App\Modules\YunQi\Services\YqZsyTestService;
|
|
|
use Closure;
|
|
|
use Cookie;
|
|
@@ -142,8 +143,8 @@ class ReadOauth
|
|
|
//云栖测试
|
|
|
$qy_test_url = $this->yqTest($request,$uid_cookie,$distribution_channel_id);
|
|
|
if($qy_test_url){
|
|
|
- //Log::info('url is: '.$qy_test_url);
|
|
|
- return redirect()->to($qy_test_url);
|
|
|
+ Log::info('url is: '.$qy_test_url);
|
|
|
+ //return redirect()->to($qy_test_url);
|
|
|
}
|
|
|
|
|
|
//只能推送的统计
|
|
@@ -800,6 +801,7 @@ class ReadOauth
|
|
|
//Log::info('44444444444444444444444444444');
|
|
|
//如果是group_1 不错操作
|
|
|
if($flag == 'group_1'){
|
|
|
+ YqUserBidRelationService::create($uid,$bid,'GROUP_1',0);
|
|
|
if ($yq_book_user->type == 'INIT'){
|
|
|
BookUserService::updateUser($uid, ['type'=>'GROUP_1']);
|
|
|
}
|
|
@@ -824,6 +826,7 @@ class ReadOauth
|
|
|
if ('ENABLE' == $type) {
|
|
|
$yq_zsy_test = YqZsyTestService::getByBid($bid);
|
|
|
if ($yq_zsy_test) {
|
|
|
+ YqUserBidRelationService::create($uid,$bid,'GROUP_2',$bid);
|
|
|
//书在测试列表中
|
|
|
$data['bid'] = $bid;
|
|
|
BookUserService::updateUser($uid, $data);
|
|
@@ -849,6 +852,7 @@ class ReadOauth
|
|
|
if($redirect){
|
|
|
$data['bid'] = $redirect_bid;
|
|
|
}
|
|
|
+ YqUserBidRelationService::create($uid,$bid,'GROUP_2',$redirect_bid);
|
|
|
BookUserService::updateUser($uid, $data);
|
|
|
return $redirect.'&'.$other_str;
|
|
|
}
|
|
@@ -871,17 +875,19 @@ class ReadOauth
|
|
|
$yq_zsy_test = YqZsyTestService::getByBid($bid);
|
|
|
//如果书在测试样本中 不跳转
|
|
|
if ($yq_zsy_test) {
|
|
|
+ YqUserBidRelationService::create($uid,$bid,'GROUP_2',0);
|
|
|
return '';
|
|
|
}
|
|
|
//Log::info('ccccccccccccccccccccccccccccc');
|
|
|
// 用户符合条件 且看的书不样本中
|
|
|
- if($yq_book_user->bid){
|
|
|
+ $relate_info = YqUserBidRelationService::getByUidAndBid($uid,$bid);
|
|
|
+ if($relate_info && $relate_info->to_bid){
|
|
|
//已经有对应关系
|
|
|
//如果有阅读记录
|
|
|
- $record_url = $this->readerRecpord($uid,$yq_book_user->bid,$channel_id);
|
|
|
+ $record_url = $this->readerRecpord($uid,$relate_info->to_bid,$channel_id);
|
|
|
if($record_url) return $record_url.'&'.$other_str;
|
|
|
//没有阅读记录
|
|
|
- $book_url = $this->getBookReaderUrl($yq_book_user->bid,$channel_id);
|
|
|
+ $book_url = $this->getBookReaderUrl($relate_info->to_bid,$channel_id);
|
|
|
//Log::info('dddddddddddddddddddddddddd');
|
|
|
//Log::info($book_url.'&'.$other_str);
|
|
|
return $book_url.'&'.$other_str;
|
|
@@ -903,6 +909,7 @@ class ReadOauth
|
|
|
//更新对应关系
|
|
|
BookUserService::updateUser($uid, $data);
|
|
|
//Log::info('ffffffffffffffffffffffff');
|
|
|
+ YqUserBidRelationService::create($uid,$bid,'GROUP_2',$redirect_bid);
|
|
|
return $redirect.'&'.$other_str;
|
|
|
}
|
|
|
//Log::info('gggggggggggggggggggggggggggggggg');
|