zilong %!s(int64=4) %!d(string=hai) anos
pai
achega
83d7dddd14
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  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()