소스 검색

课程表排序

lizhen_gitee 6 달 전
부모
커밋
2ef9ba0121
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 1
      application/admin/controller/Lessonslot.php
  2. 1 1
      application/api/controller/Lesson.php

+ 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,[]);
         }