|
@@ -1272,21 +1272,13 @@ class BookController extends BaseController
|
|
|
{
|
|
|
|
|
|
$bids = BookConfigService::getRecommendBids($package,$channel,[26],64);
|
|
|
- echo "<pre><hr>";
|
|
|
- var_export($bids);
|
|
|
- echo "<hr>";
|
|
|
- var_export(DB::getQueryLog());
|
|
|
- die();
|
|
|
- // $hotBids = BookConfigService::getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'hot',$package_id),$channel,$package,$isAuthor);
|
|
|
- // $liveBids = BookConfigService::getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'live',$package_id),$channel,$package,$isAuthor);
|
|
|
- // $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);
|
|
|
- // myLog("Qapp_home_data")->info(['liveBids' =>$liveBids,'hotbids'=>$hotBids,'new' => $newBids,'recom'=> $recomBids]);
|
|
|
+ $bids = array_chunk($bids,12);
|
|
|
+ $default = [1,1,1,1,1,1,1,1,1,1,1,1];
|
|
|
return array_filter([
|
|
|
- ['type' => 'hot', 'lable' => '热门书单', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($hotBids))],
|
|
|
- ['type' => 'zhibo', 'lable' => '神书直播', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($liveBids))],
|
|
|
- ['type' => 'recom', 'lable' => '小编精选', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($recomBids))],
|
|
|
- ['type' => 'new_recom', 'lable' => '人气新书', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($newBids))]
|
|
|
+ ['type' => 'hot', 'lable' => '热门书单', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($bids[0] ?? BookConfigService::getCheckBooks($default,$channel,$package,$is_auth)))],
|
|
|
+ ['type' => 'zhibo', 'lable' => '神书直播', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($bids[2] ?? BookConfigService::getCheckBooks($default,$channel,$package,$is_auth)))],
|
|
|
+ ['type' => 'recom', 'lable' => '小编精选', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($bids[3] ?? BookConfigService::getCheckBooks($default,$channel,$package,$is_auth)))],
|
|
|
+ ['type' => 'new_recom', 'lable' => '人气新书', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($bids[4] ?? BookConfigService::getCheckBooks($default,$channel,$package,$is_auth)))]
|
|
|
]);
|
|
|
return [];
|
|
|
}
|