zilong 4 년 전
부모
커밋
83d7dddd14
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      app/Models/Organization.php

+ 7 - 1
app/Models/Organization.php

xqd
@@ -24,7 +24,13 @@ class Organization extends BaseModel
     }
     public function docter()
     {
-        return $this->belongsToMany(Docter::class);
+        $ret = $this->belongsToMany(Docter::class)->where('status', 1);
+        $req = request()->post();
+        if (!empty($req['schedule_type'])) {
+            $ret->where('type', $req['schedule_type']);
+        }
+
+        return $ret;
     }
 
     public function vaccines()