|
@@ -4,6 +4,9 @@ namespace App\Http\Controllers\Wap\Web;
|
|
|
|
|
|
use App\Modules\Book\Services\BookConfigService;
|
|
|
use App\Modules\Book\Services\ChapterService;
|
|
|
+use App\Modules\OfficialAccount\Models\CustomSendMsgs;
|
|
|
+use App\Modules\OfficialAccount\Models\WechatTemplateMsgs;
|
|
|
+use App\Modules\OfficialAccount\Models\WechatTemplates;
|
|
|
use App\Modules\Subscribe\Services\OrderService;
|
|
|
use App\Modules\User\Services\ReadRecordService;
|
|
|
use Illuminate\Routing\Controller;
|
|
@@ -315,12 +318,6 @@ class RedirectController extends BaseController
|
|
|
}
|
|
|
parse_str($info['query'],$output);
|
|
|
if(!isset($output['bid']) || !isset($output['cid'])) return redirect()->to('/');
|
|
|
- $bid = explode(',',$output['bid'])[0];
|
|
|
- $book_info = BookConfigService::getBookById($bid);
|
|
|
- $chapter_content = ChapterService::getChapter($book_info->bid, $output['cid']);
|
|
|
- $data['chapter_list'] = explode("\r\n",$chapter_content->content);
|
|
|
- $data['name'] = $book_info->book_name;
|
|
|
- $data['next_url'] = '/reader?bid='.$output['bid'].'&cid='.$chapter_content->next_cid.'&fromtype='.$from_type;
|
|
|
if($from_type){
|
|
|
//['custom','template']
|
|
|
$push_info = explode('_',$from_type);
|
|
@@ -329,26 +326,41 @@ class RedirectController extends BaseController
|
|
|
$push_id = $push_info[1];
|
|
|
}
|
|
|
if(str_contains($from_type,['custom']) && $push_id){
|
|
|
+ $info = CustomSendMsgs::customSendMsgsById($push_id);
|
|
|
+ if(!$info || $info->distribution_channel_id != $this->distribution_channel_id){
|
|
|
+ return redirect()->to('/');
|
|
|
+ }
|
|
|
$push_transfer_custom_flag = Cookie::get('push_transfer_custom_flag');
|
|
|
if(!$push_transfer_custom_flag || !in_array($push_id,explode(',',$push_transfer_custom_flag))){
|
|
|
Redis::hincrby('push_transfer_page_custom_uv' , $push_id, 1);
|
|
|
- if($push_transfer_custom_flag) $push_transfer_custom_flag = $push_transfer_custom_flag.','.$push_id;
|
|
|
- else $push_transfer_custom_flag = $push_id;
|
|
|
+ if($push_transfer_custom_flag) {$push_transfer_custom_flag = $push_transfer_custom_flag.','.$push_id;}
|
|
|
+ else {$push_transfer_custom_flag = $push_id;}
|
|
|
Cookie::queue('push_transfer_custom_flag',$push_transfer_custom_flag, env('U_COOKIE_EXPIRE'), null, null, false, false);
|
|
|
}
|
|
|
Redis::hincrby('push_transfer_page_custom_pv' , $push_id, 1);
|
|
|
}
|
|
|
if(str_contains($from_type,['template']) && $push_id){
|
|
|
+ $info = WechatTemplateMsgs::wechatTemplateMsgsById($push_id);
|
|
|
+ if(!$info || $info->distribution_channel_id != $this->distribution_channel_id){
|
|
|
+ return redirect()->to('/');
|
|
|
+ }
|
|
|
$push_transfer_template_flag = Cookie::get('push_transfer_template_flag');
|
|
|
if(!$push_transfer_template_flag || !in_array($push_id,explode(',',$push_transfer_template_flag))){
|
|
|
Redis::hincrby('push_transfer_page_template_uv' , $push_id, 1);
|
|
|
- if($push_transfer_template_flag) $push_transfer_template_flag = $push_transfer_template_flag.','.$push_id;
|
|
|
- else $push_transfer_template_flag = $push_id;
|
|
|
+ if($push_transfer_template_flag) {$push_transfer_template_flag = $push_transfer_template_flag.','.$push_id;}
|
|
|
+ else {$push_transfer_template_flag = $push_id;}
|
|
|
Cookie::queue('push_transfer_template_flag',$push_transfer_template_flag, env('U_COOKIE_EXPIRE'), null, null, false, false);
|
|
|
}
|
|
|
Redis::hincrby('push_transfer_page_template' , $push_id, 1);
|
|
|
}
|
|
|
}
|
|
|
+ $bid = Hashids::decode($output['bid'])[0];
|
|
|
+ $book_info = BookConfigService::getBookById($bid);
|
|
|
+ $chapter_content = ChapterService::getChapter($bid, $output['cid']);
|
|
|
+
|
|
|
+ $data['chapter_list'] = explode("\r\n",$chapter_content->content);
|
|
|
+ $data['name'] = $book_info->book_name;
|
|
|
+ $data['next_url'] = '/reader?bid='.$output['bid'].'&cid='.$chapter_content->next_cid.'&fromtype='.$from_type;
|
|
|
return view('wap.customPushtransfer',$data);
|
|
|
}
|
|
|
}
|