Procházet zdrojové kódy

Merge branch 'master' into develop

zilong před 4 roky
rodič
revize
5ca3b48af7

+ 1 - 1
app/Http/Controllers/Api/V1/VaccineController.php

xqd
@@ -22,7 +22,7 @@ class VaccineController extends AuthController
             'sort_type' => 'in:0,1,2',
         ]);
 
-        $builder = Vaccine::select(['id', 'type', 'price', 'name', 'remark', 'supplier', 'stock'])->where('stock', '>', 0)->where('org_id', $req['organization_id']);
+        $builder = Vaccine::select(['id', 'type', 'price', 'name', 'remark', 'supplier', 'stock'])->where('org_id', $req['organization_id']);
         if (!empty($req['type'])) {
             $builder->where('type', $req['type']);
         }

+ 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()