Prechádzať zdrojové kódy

Merge branch 'develop'

Swdz-WangHaiJun 4 rokov pred
rodič
commit
f9fb64dd61

+ 13 - 11
app/Http/Controllers/Api/V2/DoctorController.php

xqd xqd xqd xqd xqd
@@ -1324,11 +1324,9 @@ class DoctorController extends AuthController
         $patientsArr = [];
         $ws['user_id'] = $req['user_id'];
         $ws['product_type'] = 6;
-        $fuw_order = Order::with('orderPack')->where($ws)->orderBy('created_at', 'desc')->get();
+        $fuw_order = Order::with('orderPack')->where($ws)->whereIn('order_status',[3,4])->orderBy('created_at', 'desc')->get();
         if ($fuw_order) {
             $fuw_order = $fuw_order->toArray();
-//            var_dump($fuw_order);
-
             foreach ($fuw_order as $kk => $vv) {
                 $fuwArr[$kk]['order_id'] = $vv['id'];
                 if ($vv['order_pack']) {
@@ -1398,20 +1396,15 @@ class DoctorController extends AuthController
 
         // 拼接服务消息
         $wh['user_id'] = $req['user_id'];
-        $wh['order_status'] = ['>', 3];
         $wh['product_type'] = 6;
         $fuwuList = [];
-        $fuwuInfo = Order::where($wh)->get();
+        $fuwuInfo = Order::where($wh)->whereIn('order_status',[3,4])->get();
         $fuwuList['fuwu_num'] = count($fuwuInfo);
         $whs['user_id'] = $req['user_id'];
-        $whs['order_status'] = ['>', 3];
-        $order_nums = Order::where($whs)->get();
-
+        $order_nums = Order::where($whs)->whereIn('order_status',[3,4])->get();
         $fuwuList['order_num'] = count($order_nums);
         $pati_nums = Patient::where('user_id', '=', $req['user_id'])->get();
         $fuwuList['pati_num'] = count($pati_nums);
-
-
         $returnArr = [
             'user_arr' => $userArr,
             'patients_arr' => $patientsArr,//患者档案
@@ -1441,7 +1434,7 @@ class DoctorController extends AuthController
             $finds = $finds->toArray();
         }
         if ($finds['sex'] == 0) {
-            $finds['sex'] = '中性';
+            $finds['sex'] = '未知';
         } elseif ($finds['sex'] == 1) {
             $finds['sex'] = '男';
         } else {
@@ -1502,6 +1495,9 @@ class DoctorController extends AuthController
                     case 7:
                         $patient_arr[$k]['product_type'] = '充值';
                         break;
+                    case 8:
+                        $patient_arr[$k]['product_type'] = '快速预约';
+                        break;
                     default:
                         $patient_arr[$k]['product_type'] = '错误';
                 }
@@ -1521,6 +1517,12 @@ class DoctorController extends AuthController
                     case 5:
                         $patient_arr[$k]['order_status'] = '已取消';
                         break;
+                    case 6:
+                        $patient_arr[$k]['order_status'] = '已超时';
+                        break;
+                    case 7:
+                        $patient_arr[$k]['order_status'] = '已预约';
+                        break;
                     default:
                         $patient_arr[$k]['order_status'] = '未知';
                 }

+ 6 - 2
app/Http/Controllers/Api/V2/PatientController.php

xqd xqd xqd
@@ -255,7 +255,7 @@ class PatientController extends AuthController
         }
 
         $axbwhere['docter_id'] = $user['id'];
-        $axbwhere['user_id'] = $req['user_id'];
+        $axbwhere['user_id'] = $find['user_id'];
         $finds = Axb::where($axbwhere)->orderBy('id', 'desc')->first();
 
         if ($status == 1 && $finds) {
@@ -424,7 +424,7 @@ class PatientController extends AuthController
         ]);
         $data = [];
         // 订单查询
-        $data = Order::with(['orderPatient', 'user', 'calllog'])->where('id', $req['patient_id'])->first()->toArray();
+        $data = Order::with(['orderPatient', 'user', 'calllog'])->where('id', $req['patient_id'])->first();
 
         // 通话记录查询
         $datas = CallLog::where('order_id', $req['patient_id'])->get();
@@ -436,6 +436,10 @@ class PatientController extends AuthController
         $res_patient = [];
 
         //电话咨询
+        //电话咨询
+        if ($data){
+            $data=$data->toArray();
+        }
 
         if ($data['product_type'] == 1) {