lizhen_gitee 10 meses atrás
pai
commit
d406491219
1 arquivos alterados com 15 adições e 2 exclusões
  1. 15 2
      application/api/controller/doctor/Index.php

+ 15 - 2
application/api/controller/doctor/Index.php

@@ -17,11 +17,21 @@ class Index extends Apic
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
+    /*public function test(){
+        $page = input('page',1);//分页
+        $a = $this->get_page_week($page);
+        foreach($a as &$v){
+            $v = date('Y-m-d H:i:s',$v);
+        }
+        dump($a);
+    }*/
+
     private function get_page_week($page = 1)
     {
+        $time = time() + (($page - 1)*604800);
         $arr = [
-            strtotime('Monday this week'),
-            strtotime('Sunday this week'),
+            strtotime('Monday this week',$time),
+            strtotime('Sunday this week',$time),
         ];
 
         return $arr;
@@ -32,6 +42,9 @@ class Index extends Apic
         $today = date('Y-m-d');//今天
 
         $page = input('page',1);//分页
+        if($page < 1){
+            $this->error('不能修改本周前的排班');
+        }
 
         //某周,page=1是本周
         $this_week = $this->get_page_week($page);