Bläddra i källkod

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

whj 4 år sedan
förälder
incheckning
678dcd0647

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

xqd xqd
@@ -439,7 +439,7 @@ class OrderController extends AuthController
         ]);
         $user = $this->user;
 
-        $builder = Order::with(['docter.office', 'docter.qualification', 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine'])->where('user_id', $user['id']);
+        $builder = Order::with(['docter.office', 'docter.qualification', 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine', 'organization.docter'])->where('user_id', $user['id']);
         if (!empty($req['product_type'])) {
             $builder->where('product_type', $req['product_type']);
         }
@@ -476,7 +476,7 @@ class OrderController extends AuthController
         ]);
         $user = $this->user;
 
-        $data = Order::with(['docter.office', 'docter.qualification', 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine'])->where('id', $req['order_id'])->where('user_id', $user['id'])->first();
+        $data = Order::with(['docter.office', 'docter.qualification', 'orderPatient', 'orderPack', 'orderNurse', 'orderVaccine', 'organization.docter'])->where('id', $req['order_id'])->where('user_id', $user['id'])->first();
 
         return out($data);
     }

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

xqd
@@ -52,7 +52,7 @@ class PatientController extends AuthController
         $data = [];
         $data['patient'] = Patient::where('id', $req['patient_id'])->where('user_id', $user['id'])->first();
 
-        $data['orders']['cases'] = Order::with(['docter.office', 'docter.qualification'])->where('user_id', $user['id'])->where('patient_id', $req['patient_id'])->whereIn('order_status', [2,3])->where('product_type', '<', 6)->orderBy('id', 'desc')->get();
+        $data['orders']['cases'] = Order::with(['docter.office', 'docter.qualification', 'organization.docter'])->where('user_id', $user['id'])->where('patient_id', $req['patient_id'])->whereIn('order_status', [2,3])->where('product_type', '<', 6)->orderBy('id', 'desc')->get();
         $data['orders']['service_packs'] = Order::with('orderPack')->where('user_id', $user['id'])->where('patient_id', $req['patient_id'])->whereIn('order_status', [2,3])->where('product_type', 6)->orderBy('id', 'desc')->get();
 
         return out($data);

+ 5 - 0
app/Models/Order.php

xqd
@@ -53,4 +53,9 @@ class Order extends BaseModel
     {
         return $this->hasOne(User::class,'id','user_id');
     }
+
+    public function organization()
+    {
+        return $this->belongsTo(Organization::class);
+    }
 }