Browse Source

'补充条件'

zhuchengjie 3 years ago
parent
commit
575621813a
1 changed files with 4 additions and 3 deletions
  1. 4 3
      app/Http/Controllers/QuickApp/Book/BookController.php

+ 4 - 3
app/Http/Controllers/QuickApp/Book/BookController.php

@@ -265,6 +265,7 @@ class BookController extends BaseController
         $book_count = 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)
             ->count();
@@ -279,12 +280,12 @@ class BookController extends BaseController
         //获取随机的有效的书籍bid
         $rand_bid = BookConfig::join('books', 'book_configs.bid', '=', 'books.id')
             ->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
-            ->where('book_configs.is_on_shelf',1)
+            ->where('book_configs.is_on_shelf',2)
             ->whereNotIn('book_configs.cp_source',getHiddenCp())
+            ->where('book_categories.pid',$channel)
             ->inRandomOrder()
             ->limit($supplement_count)
-            ->where('book_categories.pid',$channel)
-            ->get()->pluck('book_configs.bid')->toArray();
+            ->get()->pluck('bid')->toArray();
 
         return array_filter(array_merge($bid_list,$rand_bid));
     }