Kaynağa Gözat

fix(diagnostic): use numeric chapter order before display_no

yemeishu 1 hafta önce
ebeveyn
işleme
d581c06a00
1 değiştirilmiş dosya ile 10 ekleme ve 10 silme
  1. 10 10
      app/Services/DiagnosticChapterService.php

+ 10 - 10
app/Services/DiagnosticChapterService.php

@@ -15,8 +15,8 @@ class DiagnosticChapterService
         $chapters = TextbookCatalog::query()
             ->where('textbook_id', $textbookId)
             ->where('node_type', 'chapter')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->get();
 
@@ -34,8 +34,8 @@ class DiagnosticChapterService
             $sectionIds = TextbookCatalog::query()
                 ->where('parent_id', $chapter->id)
                 ->where('node_type', 'section')
-                ->orderBy('display_no')
                 ->orderBy('sort_order')
+                ->orderBy('display_no')
                 ->orderBy('id')
                 ->pluck('id')
                 ->toArray();
@@ -79,8 +79,8 @@ class DiagnosticChapterService
         $chapter = TextbookCatalog::query()
             ->where('textbook_id', $textbookId)
             ->where('node_type', 'chapter')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->first();
 
@@ -94,8 +94,8 @@ class DiagnosticChapterService
         $sectionIds = TextbookCatalog::query()
             ->where('parent_id', $chapter->id)
             ->where('node_type', 'section')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->pluck('id')
             ->toArray();
@@ -140,8 +140,8 @@ class DiagnosticChapterService
         $chapters = TextbookCatalog::query()
             ->where('textbook_id', $textbookId)
             ->where('node_type', 'chapter')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->get();
 
@@ -156,8 +156,8 @@ class DiagnosticChapterService
             $sectionIds = TextbookCatalog::query()
                 ->where('parent_id', $chapter->id)
                 ->where('node_type', 'section')
-                ->orderBy('display_no')
                 ->orderBy('sort_order')
+                ->orderBy('display_no')
                 ->orderBy('id')
                 ->pluck('id')
                 ->toArray();
@@ -263,8 +263,8 @@ class DiagnosticChapterService
         $sectionIds = TextbookCatalog::query()
             ->where('parent_id', $chapterId)
             ->where('node_type', 'section')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->pluck('id')
             ->toArray();
@@ -315,8 +315,8 @@ class DiagnosticChapterService
         $chapters = TextbookCatalog::query()
             ->where('textbook_id', $textbookId)
             ->where('node_type', 'chapter')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->get();
 
@@ -383,8 +383,8 @@ class DiagnosticChapterService
         $chapters = TextbookCatalog::query()
             ->where('textbook_id', $textbookId)
             ->where('node_type', 'chapter')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->get();
 
@@ -445,8 +445,8 @@ class DiagnosticChapterService
         $chapters = TextbookCatalog::query()
             ->where('textbook_id', $textbookId)
             ->where('node_type', 'chapter')
-            ->orderBy('display_no')
             ->orderBy('sort_order')
+            ->orderBy('display_no')
             ->orderBy('id')
             ->get();