Browse Source

视频问诊,即时方式

lizhen_gitee 6 months ago
parent
commit
33eaa47f7a

+ 13 - 5
application/api/controller/Index.php

@@ -74,7 +74,7 @@ class Index extends Api
             'd.id','d.nickname','d.avatar','d.keshi_id','d.level_id','d.hospital','d.goodat','d.ordernum',
             'keshi.name as keshi_name',
             'level.name as level_name','level.name_en as level_name_en',
-            'info.typing_switch','info.video_switch','info.typing_price','info.video_price',
+            'info.typing_switch','info.video_switch','info.typing_price','info.video_price','info.video_model'
         ];
         $list = Db::name('doctor')->alias('d')
             ->field($field)
@@ -92,10 +92,10 @@ class Index extends Api
         $id = input('id',0);
 
         $field = [
-            'd.id','d.nickname','d.avatar','d.keshi_id','d.level_id','d.hospital','d.goodat','d.ordernum','d.info',
+            'd.id','d.nickname','d.avatar','d.keshi_id','d.level_id','d.hospital','d.goodat','d.ordernum','d.info','d.job_status',
             'keshi.name as keshi_name',
             'level.name as level_name',
-            'info.typing_switch','info.video_switch','info.typing_price','info.video_price',
+            'info.typing_switch','info.video_switch','info.typing_price','info.video_price','info.video_model',
         ];
         $info = Db::name('doctor')->alias('d')
             ->field($field)
@@ -113,8 +113,16 @@ class Index extends Api
         //视频说明
         $info['wenzhen_video_serverrule'] = config('site.wenzhen_video_serverrule');
 
-        //该医生的视频预约详情
-        if($info['video_switch'] == 1){
+        //没上班,文字接诊 停掉
+        if($info['typing_switch'] == 1 && $info['job_status'] == 0){
+            $info['typing_switch'] == 2;
+        }
+        //没上班,即时视频 停掉
+        if($info['video_switch'] == 1 && $info['video_model'] == 2 && $info['job_status'] == 0){
+            $info['video_switch'] == 2;
+        }
+        //视频问诊,排班模式,如果没排班 停掉
+        if($info['video_switch'] == 1 && $info['video_model'] == 1){
             $paiban_list = $this->doctor_paiban($id,true);
             if(empty($paiban_list)){
                 $info['video_switch'] = 2;//表示没有排班了,或已经约满

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

@@ -60,7 +60,7 @@ class Sms extends Api
         if ($ret) {
             $this->success(__('发送成功'));
         } else {
-            $this->error(__('发送失败,请检查短信配置是否正确'));
+            $this->error(__('发送失败'));
         }
     }
 

+ 10 - 0
application/api/controller/Wenzhen.php

@@ -66,6 +66,9 @@ class Wenzhen extends Api
             if($doctor_info['video_switch'] != 1){
                 $this->error('该医生未开通视频问诊');
             }
+            if($doctor_info['video_model'] == 2 && $doctor['job_status'] != 1){ //即时方式,需要在上班中
+                $this->error('该医生现在不在上班中');
+            }
             $price = $doctor_info['video_price'];
         }
         if($price <= 0){
@@ -77,6 +80,7 @@ class Wenzhen extends Api
             $book_time = 0;
         }
         if($ordertype == 2){
+            if($doctor_info['video_model'] == 1){  //排班预约
             //检查
             if($book_time < time() + 7200){
                 //测试临时屏蔽
@@ -101,6 +105,11 @@ class Wenzhen extends Api
             if($order_count >= 4){
                 $this->error('该时间点已排满,请重选预约时间');
             }
+            }
+            else
+            {
+                $book_time = time();                //即时预约
+            }
 
         }
 
@@ -115,6 +124,7 @@ class Wenzhen extends Api
             'book_time'  => $book_time,
             'createtime' => time(),
             'status'     => 0,//订单状态enum
+            'video_model'=> $doctor_info['video_model'],  //视频问诊预约方式
         ];
 
         Db::startTrans();

+ 1 - 0
application/api/controller/doctor/User.php

@@ -338,6 +338,7 @@ class User extends Apic
         $field_array = [
             'typing_switch',
             'video_switch',
+            'video_model',
             'typing_price',
             'video_price',
             'notice_switch',