zilong 4 lat temu
rodzic
commit
66df811143

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

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

+ 5 - 0
app/Models/Order.php

xqd
@@ -86,4 +86,9 @@ class Order extends BaseModel
 
         return true;
     }
+
+    public function suggest()
+    {
+        return $this->hasOne(Suggest::class)->select(['id', 'order_id']);
+    }
 }