zilong 4 năm trước cách đây
mục cha
commit
83d7dddd14
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  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()