Browse Source

'为空返回判断'

zhuchengjie 3 năm trước cách đây
mục cha
commit
b8931579a1
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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')