|
@@ -6,6 +6,7 @@ namespace App\Modules\Book\Services;
|
|
|
|
|
|
use App\Http\Controllers\QuickApp\Book\Transformers\BookTransformer;
|
|
|
use App\Modules\Book\Models\BookConfig;
|
|
|
+use App\Modules\RecommendBook\Services\QappRecommendService;
|
|
|
|
|
|
class BookAuditService
|
|
|
{
|
|
@@ -173,4 +174,21 @@ class BookAuditService
|
|
|
|
|
|
return array_filter(array_merge($bid_list,$rand_bid));
|
|
|
}
|
|
|
+
|
|
|
+ public static function getHuPoHomeBooksData($channel,$books,$package_id,$package): array
|
|
|
+ {
|
|
|
+ $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);
|
|
|
+
|
|
|
+ return array_filter([
|
|
|
+ ['type' => 'reco_banner', 'lable' => '首页banner', 'books' => $books],
|
|
|
+ ['type' => 'hot', 'lable' => '热门书单', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds(self::getCheckBooks($hotBids,$channel,$package,$isAuthor),[],false))],
|
|
|
+ ['type' => 'zhibo', 'lable' => '神书直播', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds(self::getCheckBooks($liveBids,$channel,$package,$isAuthor),[],false))],
|
|
|
+ ['type' => 'recom', 'lable' => '小编精选', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($recomBids))],
|
|
|
+ ['type' => 'new_recom', 'lable' => '人气新书', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($newBids))]
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|