fly 4 éve
szülő
commit
c814bdcdbd
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      src/Services/Book/BookService.php

+ 2 - 1
src/Services/Book/BookService.php

@@ -64,8 +64,9 @@ class BookService
      */
     public function getBooks(array $params, bool $is_page = true)
     {
+        $sql = BookConfig::orderBy('bid', 'desc');
         if (isset($params['type']) && $params['type']) {
-            $sql = BookConfig::where('is_on_shelf', $params['type']);
+            $sql = $sql->where('is_on_shelf', $params['type']);
             if ($params['type'] == 1) {
                 $sql->orderBy('id', 'desc');
             }