Parcourir la source

'为空返回判断'

zhuchengjie il y a 3 ans
Parent
commit
b8931579a1
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      app/Modules/Book/Services/BookConfigService.php

+ 3 - 0
app/Modules/Book/Services/BookConfigService.php

@@ -154,6 +154,9 @@ class BookConfigService
                 ->where('is_enabled', 1)
                 ->get();
             $bids = $free_books->pluck('bid')->all();
+            if(empty($bids)){
+                return [];
+            }
             $book_configs = BookConfig::whereIn('bid', $bids)
                 ->where('is_on_shelf', 2)
                 ->select('bid', 'book_name', 'cover')