|
@@ -306,10 +306,18 @@ class ChapterController extends BaseController
|
|
|
return response()->error('WAP_NOT_LOGIN');
|
|
|
}
|
|
|
$this->en_bid = $bid;
|
|
|
+
|
|
|
$bid = Hashids::decode($bid)[0];
|
|
|
//获取图书信息
|
|
|
$book_info = BookConfigService::getBookById($bid);
|
|
|
|
|
|
+ //是否开启全站按章模式
|
|
|
+ $global_charge_by_chapter_channels = explode(',',env('GLOBAL_CHARGE_BY_CHAPTER_CHANNEL'));
|
|
|
+ if(in_array($this->distribution_channel_id,$global_charge_by_chapter_channels))
|
|
|
+ {
|
|
|
+ $book_info->charge_type = 'CHAPTER';
|
|
|
+ }
|
|
|
+
|
|
|
if (empty($book_info)) return response()->error('WAP_SYS_ERROR');
|
|
|
$this->book_info = $book_info;
|
|
|
$this->cid = $cid;
|
|
@@ -339,6 +347,14 @@ class ChapterController extends BaseController
|
|
|
//用户是否强关
|
|
|
$this->is_had_subscribe = $is_had_subscribe = $inter_not_need_sub ? true : $this->getSubscribe();
|
|
|
|
|
|
+ //判断当前是否有强制显示服务号信息的cookie、已经关注 跳转到服务号信息引导页
|
|
|
+ if(Cookie::get('force_show_qrcode') && $is_had_subscribe)
|
|
|
+ {
|
|
|
+ $force_read_url = '/subscribe/getFromUser';//服务号信息引导页
|
|
|
+ $force_read_data = ['src' => $force_read_url];
|
|
|
+ return response()->error('WAP_NOT_SUBSCRIBE', $force_read_data);
|
|
|
+ }
|
|
|
+
|
|
|
//获取强关章节数
|
|
|
$subscribe_seq = $this->getSubscribeChapterNum($book_info);
|
|
|
//章节是否需要强关 TRUE:不需要,false:需要
|
|
@@ -370,6 +386,7 @@ class ChapterController extends BaseController
|
|
|
$this->getChapter();
|
|
|
return response()->item(new ChapterTransformer, $this->chapter);
|
|
|
}
|
|
|
+
|
|
|
//需要强制关注 不是vip章节 已经关注了
|
|
|
if (!$force_subscribe && $chapter->is_vip == 0 && $is_had_subscribe) {
|
|
|
$this->getChapter();
|
|
@@ -677,6 +694,11 @@ class ChapterController extends BaseController
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ private function getOfficialAccountForceReadNotice()
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//强关页面的统计
|
|
|
private function subscribeStats()
|
|
|
{
|