Browse Source

打视频前置接口

lizhen_gitee 9 months ago
parent
commit
2c5e2113bd

+ 1 - 1
application/api/controller/Wenzhen.php

@@ -414,7 +414,7 @@ class Wenzhen extends Api
                 'seconds' => 0,
             ],
             25 => [
-                'name'=>'视频问诊中',
+                'name'=>'视频问诊进行中',
                 'name_en'=>'Time Remaining',
                 'minute' => '',
                 'minute_en' => '',

+ 31 - 0
application/api/controller/doctor/Wenzhen.php

@@ -308,6 +308,37 @@ class Wenzhen extends Apic
         $this->success('接珍成功');
     }
 
+    //第一次拨打视频之前
+    public function before_first_video(){
+
+        //订单详情
+        $order_id = input('order_id',0);
+        $wenzhen_order = Db::name('wenzhen_order')->where('doctor_id',$this->auth->id)->where('id',$order_id)->find();
+        if(empty($wenzhen_order)){
+            $this->error('不存在的订单');
+        }
+
+        if($wenzhen_order['ordertype'] != 2){
+            $this->error('视频订单才能拨打视频');
+        }
+
+        if($wenzhen_order['status'] == 30){
+            $this->error('订单已结束');
+        }
+        if($wenzhen_order['status'] == 25){
+            $this->success();
+        }
+        if($wenzhen_order['status'] != 20){
+            $this->error('订单未接诊');
+        }
+
+        if($wenzhen_order['book_time'] > time()){
+            $this->error('未到预约时间');
+        }
+
+        $this->success('操作成功');
+    }
+
     //第一次拨打视频
     public function first_video(){
         $apilimit = $this->apiLimit();