|
@@ -188,6 +188,11 @@ class BookController extends BaseController
|
|
return $item;
|
|
return $item;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ if(!$this->send_order_id){
|
|
|
|
+ $result = $this->getCheckBids($channel,$books);
|
|
|
|
+ return response()->success($result);
|
|
|
|
+ }
|
|
|
|
+
|
|
$hotBids = RecommendService::getRecommendIdsStatic($channel, 'hot');
|
|
$hotBids = RecommendService::getRecommendIdsStatic($channel, 'hot');
|
|
$liveBids = RecommendService::getRecommendIdsStatic($channel, 'live');
|
|
$liveBids = RecommendService::getRecommendIdsStatic($channel, 'live');
|
|
$recomBids = RecommendService::getRecommendIdsStatic($channel, 'recom');
|
|
$recomBids = RecommendService::getRecommendIdsStatic($channel, 'recom');
|
|
@@ -203,6 +208,39 @@ class BookController extends BaseController
|
|
return response()->success($result);
|
|
return response()->success($result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param $channel
|
|
|
|
+ * @param $books
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ private function getCheckBids($channel,$books)
|
|
|
|
+ {
|
|
|
|
+ if($channel == 1){
|
|
|
|
+ $hotBids = [13577,16712,13336,12717,15103,13928];
|
|
|
|
+ $loopBids = [7287,14297,12716,14312,14000];
|
|
|
|
+ $liveBids = [14793,12708,13286,13002,14004,13073];
|
|
|
|
+ $recomBids = [15121,13929,13275,13254,14072,10313];
|
|
|
|
+ $newBids = [3483,13278,12693,4098,10378,3526];
|
|
|
|
+ }else{
|
|
|
|
+ $loopBids = [];
|
|
|
|
+ $hotBids = RecommendService::getRecommendIdsStatic($channel, 'hot');
|
|
|
|
+ $liveBids = RecommendService::getRecommendIdsStatic($channel, 'live');
|
|
|
|
+ $recomBids = RecommendService::getRecommendIdsStatic($channel, 'recom');
|
|
|
|
+ $newBids = RecommendService::getRecommendIdsStatic($channel, 'new_recom');
|
|
|
|
+ $newBids = array_replace($newBids,[array_search('13563',$newBids) => 10721]);
|
|
|
|
+ }
|
|
|
|
+ return array_filter([
|
|
|
|
+ ['type' => 'reco_banner', 'lable' => '首页banner', 'books' => $books],
|
|
|
|
+ ['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))],
|
|
|
|
+ !empty($loopBids) ? ['type' => 'loop', 'lable' => '轮播图', 'books' => collectionTransform(new BookTransformer, BookConfigService::getBooksByIds($loopBids))] : []
|
|
|
|
+ ]);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
private function getBidCidFromUrl(string $url)
|
|
private function getBidCidFromUrl(string $url)
|
|
{
|
|
{
|