Browse Source

去除数据库随机

wangzq 2 years ago
parent
commit
ca729def45

+ 1 - 1
app/Modules/Book/Services/BookAuditService.php

@@ -167,7 +167,7 @@ class BookAuditService
             ->whereNotIn('book_configs.cp_source',$hidden_cp)
 
             ->where('book_categories.pid',$channel)
-            ->inRandomOrder()
+            ->orderBy('book_configs.recommend_index', 'desc')
             ->limit($supplement_count)
             ->get()->pluck('bid')->toArray();
 

+ 2 - 1
app/Modules/Book/Services/BookConfigService.php

@@ -330,7 +330,8 @@ class BookConfigService
             // ->where('book_configs.is_high_quality',1)
             ->where('book_categories.pid', $channel)
             ->orderBy('book_configs.is_high_quality', 'desc')
-            ->inRandomOrder()
+            // ->inRandomOrder()
+            ->orderBy('book_configs.recommend_index', 'desc')
             ->limit($supplement_count)
             ->pluck('book_configs.bid')->all();
         return array_filter(array_merge($bid_list, $rand_bid));