|
@@ -277,6 +277,16 @@ class BookController extends BaseController
|
|
|
if($supplement_count <= 0){
|
|
|
return $bid_list;
|
|
|
}
|
|
|
+ //获取书籍交集bid,过滤掉不符合要求的书
|
|
|
+ $bids = BookConfig::join('books', 'book_configs.bid', '=', 'books.id')
|
|
|
+ ->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
|
|
|
+ ->whereIn('book_configs.bid',$bid_list)
|
|
|
+ ->where('book_configs.is_on_shelf',2)
|
|
|
+ ->whereNotIn('book_configs.cp_source',getHiddenCp())
|
|
|
+ ->where('book_categories.pid',$channel)
|
|
|
+ ->pluck('book_configs.bid')->all();
|
|
|
+ $bid_list = array_intersect($bid_list,$bids);
|
|
|
+
|
|
|
//获取随机的有效的书籍bid
|
|
|
$rand_bid = BookConfig::join('books', 'book_configs.bid', '=', 'books.id')
|
|
|
->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
|