Browse Source

课程表排序

lizhen_gitee 6 months ago
parent
commit
2ef9ba0121

+ 2 - 1
application/admin/controller/Lessonslot.php

@@ -57,7 +57,8 @@ class Lessonslot extends Backend
             $list = $this->model
                     ->with(['coach','lesson','danceroom'])
                     ->where($where)
-                    ->order($sort, $order)
+//                    ->order($sort, $order)
+                    ->order('lessonslot.starttime asc,lessonslot.id asc')
                     ->paginate($limit);
 
             foreach ($list as $row) {

+ 1 - 1
application/api/controller/Lesson.php

@@ -198,7 +198,7 @@ class Lesson extends Api
             }
         }
 
-        $list = $list->order('slot.starttime asc')->select();
+        $list = $list->order('slot.starttime asc,slot.id asc')->select();
         if(empty($list)){
             $this->success(1,[]);
         }