Sfoglia il codice sorgente

Merge branch 'master' of http://git.9026.com/swdz-WangHaijun/BaoMa

ChenWuJie 4 anni fa
parent
commit
e5c4b0f0d6
2 ha cambiato i file con 13 aggiunte e 3 eliminazioni
  1. 2 2
      app/Http/Controllers/Api/V1/PatientController.php
  2. 11 1
      app/Models/Docter.php

+ 2 - 2
app/Http/Controllers/Api/V1/PatientController.php

xqd xqd
@@ -25,7 +25,7 @@ class PatientController extends AuthController
             'info' => 'max:1000',
             'card_type' => 'in:0,1,2',
             'card_number' => 'max:50',
-            'email' => 'required|email',
+            'email' => 'email',
             'phone' => 'required',
             'guardian_name' => 'required',
             'address' => 'required',
@@ -53,7 +53,7 @@ class PatientController extends AuthController
             'info' => 'max:1000',
             'card_type' => 'in:0,1,2',
             'card_number' => 'max:50',
-            'email' => 'required|email',
+            'email' => 'email',
             'phone' => 'required',
             'guardian_name' => 'required',
             'address' => 'required',

+ 11 - 1
app/Models/Docter.php

xqd xqd
@@ -13,7 +13,7 @@ class Docter extends BaseModel
     protected $casts = [
         'label' => 'json',
     ];
-    protected $appends = ['is_collect'];
+    protected $appends = ['is_collect', 'label_texts'];
 
     public function office()
     {
@@ -64,4 +64,14 @@ class Docter extends BaseModel
     {
         return $this->hasOne(Serviceapplys::class);
     }
+
+    public function getLabelTextsAttribute()
+    {
+        $data = [];
+        if (!empty($this->label)) {
+            $data = DocterLabel::select(['name'])->whereIn('id', $this->label)->where('status', 1)->get()->toArray();
+        }
+
+        return $data;
+    }
 }