|
@@ -87,36 +87,15 @@ class BookAuditService
|
|
|
// 模块
|
|
|
[$hot, $live, $recom, $new] = [$home['hot'], $home['zhibo'], $home['recom'], $home['new_recom']];
|
|
|
[$hotBids, $liveBids, $recomBids, $newBids] = BookConfigService::HomePageRecomBookCheck($hot, $live, $recom, $new,$package_id, $package,$channel,false);
|
|
|
- return [
|
|
|
- [
|
|
|
- 'type' => 'reco_banner',
|
|
|
- 'lable' => $banner['label'],
|
|
|
- 'books' => $bannerBooks
|
|
|
- ],
|
|
|
- [
|
|
|
- 'type' => 'hot',
|
|
|
- 'lable' => $hot['label'],
|
|
|
- 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($hotBids,[],false)),
|
|
|
- ],
|
|
|
- [
|
|
|
- 'type' => 'zhibo',
|
|
|
- 'lable' => $live['label'],
|
|
|
- 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($liveBids,[],false)),
|
|
|
- ],
|
|
|
- [
|
|
|
- 'type' => 'recom',
|
|
|
- 'lable' => $recom['label'],
|
|
|
- // 'books' => collectionTransform(new BookTransformer, collect($books)->whereIn('bid', $recomBids)->all())
|
|
|
- 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($recomBids,[],false)),
|
|
|
|
|
|
- ],
|
|
|
- [
|
|
|
- 'type' => 'new_recom',
|
|
|
- 'lable' => $new['label'],
|
|
|
- // 'books' => collectionTransform(new BookTransformer, collect($books)->whereIn('bid', $newBids)->all())
|
|
|
- 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($newBids,[],false)),
|
|
|
- ],
|
|
|
- ];
|
|
|
+ return array_filter([
|
|
|
+ ['type' => 'reco_banner', 'lable' => '首页banner', 'books' => $bannerBooks],
|
|
|
+ ['type' => 'hot', 'lable' => '热门书单', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($hotBids,['recommend_index','desc'],false))],
|
|
|
+ ['type' => 'zhibo', 'lable' => '神书直播', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($liveBids,['recommend_index','desc'],false))],
|
|
|
+ ['type' => 'recom', 'lable' => '小编精选', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($recomBids,['recommend_index','desc'],false))],
|
|
|
+ ['type' => 'new_recom', 'lable' => '人气新书', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($newBids,['recommend_index','desc'],false))],
|
|
|
+ ]);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private static function getCheckBooks($bid_list,$channel,$package,$is_author)
|
|
@@ -179,8 +158,9 @@ class BookAuditService
|
|
|
$isAuthor = check_qapp_auth($package_id,1);
|
|
|
$hotBids = [65741,65743,65742,65744,66474,66475];
|
|
|
$liveBids = [66476,66477,66479,66480,66631,61596];
|
|
|
- $recomBids = BookConfigService::getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'recom',$package_id),$channel,$package,$isAuthor);
|
|
|
- $newBids = BookConfigService::getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'new_recom',$package_id),$channel,$package,$isAuthor);
|
|
|
+ $recomBids = QappRecommendService::getRecommendByPacketId($channel, 'recom',$package_id);
|
|
|
+ $newBids = QappRecommendService::getRecommendByPacketId($channel, 'new_recom',$package_id);
|
|
|
+ [$hotBids, $liveBids, $recomBids, $newBids] = BookConfigService::HomePageRecomBookCheck($hotBids, $liveBids, $recomBids, $newBids,$package_id, $package,$channel,false);
|
|
|
|
|
|
return array_filter([
|
|
|
['type' => 'reco_banner', 'lable' => '首页banner', 'books' => $books],
|