Просмотр исходного кода

教师端显示两个月的课程

lizhen_gitee 2 месяцев назад
Родитель
Сommit
f2e7a412ea
1 измененных файлов с 16 добавлено и 5 удалено
  1. 16 5
      application/api/controller/coach/Lesson.php

+ 16 - 5
application/api/controller/coach/Lesson.php

@@ -75,14 +75,25 @@ class Lesson extends Apic
         $this->success(1,$list);
     }
 
+    public function slot_index(){
+        $this_month = date('Y-m');
+        $this_month_data = $this->slot_index_month($this_month);
+
+        $next_month = date('Y-m',strtotime('first day of next month'));
+        $next_month_data = $this->slot_index_month($next_month);
+
+        $this->success(1,array_merge($this_month_data,$next_month_data));
+    }
+
+
     //课时列表首页
     //根据年,月获取当月剩余日期,有课程的标记1
-    public function slot_index(){
+    public function slot_index_month($getdate){
 
-        $getdate = input('date',date('Y-m'));
+       /* $getdate = input('date',date('Y-m'));
         if(empty($getdate)){
             $getdate = date('Y-m');
-        }
+        }*/
         $year = substr($getdate,0,4);
         $month = substr($getdate,-2,2);
 
@@ -175,8 +186,8 @@ class Lesson extends Apic
 
             $date_arr[] = $i_data;
         }
-
-        $this->success(1,$date_arr);
+        return $date_arr;
+//        $this->success(1,$date_arr);
     }
 
     //课时详情