|
@@ -273,7 +273,9 @@ class BookController extends BaseController
|
|
|
}
|
|
|
//获取需要补充的书籍数量
|
|
|
$supplement_count = (($count - $book_count) > 0) ? $count - $book_count : 0;
|
|
|
-
|
|
|
+ if($supplement_count <= 0){
|
|
|
+ return $bid_list;
|
|
|
+ }
|
|
|
//获取随机的有效的书籍bid
|
|
|
$rand_bid = BookConfig::join('books', 'book_configs.bid', '=', 'books.id')
|
|
|
->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
|
|
@@ -284,7 +286,7 @@ class BookController extends BaseController
|
|
|
->where('book_categories.pid',$channel)
|
|
|
->get()->pluck('book_configs.bid')->toArray();
|
|
|
|
|
|
- return array_merge($bid_list,$rand_bid);
|
|
|
+ return array_fill(array_merge($bid_list,$rand_bid));
|
|
|
}
|
|
|
|
|
|
private function getBidCidFromUrl(string $url)
|