ソースを参照

视频打通之后倒计时

lizhen_gitee 9 ヶ月 前
コミット
5aa0af978c

+ 34 - 4
application/api/controller/doctor/Wenzhen.php

@@ -308,7 +308,7 @@ class Wenzhen extends Apic
         $this->success('接珍成功');
     }
 
-    //第一次拨打视频之前
+    //第一次拨打视频之前,20,25可以调用
     public function before_first_video(){
 
         //订单详情
@@ -326,6 +326,13 @@ class Wenzhen extends Apic
             $this->error('订单已结束');
         }
         if($wenzhen_order['status'] == 25){
+            //判断患者在线状态
+            $tenim = new Tenim();
+            $rs_online = $tenim->is_online('user'.$wenzhen_order['user_id']);
+            if($rs_online != true){
+                $this->error('患者现在不在线,请稍后拨打');
+            }
+
             $this->success();
         }
         if($wenzhen_order['status'] != 20){
@@ -368,6 +375,18 @@ class Wenzhen extends Apic
             $this->error('订单已结束');
         }
         if($wenzhen_order['status'] == 25){
+            //倒计时
+            $minute = config('site.firstvideo_videoorder_autofinish_minute');
+            if($wenzhen_order['comefrom'] == 2){
+                $minute = config('site.tv_firstvideo_videoorder_autofinish_minute');
+            }
+
+            $rs = [
+                'video_time'    => $wenzhen_order['video_time'],
+                'video_endtime' => $wenzhen_order['video_time'] + $minute*60,
+            ];
+            $rs['seconds'] = $rs['video_endtime'] - time();
+
             $this->success();
         }
         if($wenzhen_order['status'] != 20){
@@ -381,10 +400,9 @@ class Wenzhen extends Apic
         //判断患者在线状态
 
         //修改订单
-        $nowtime = time();
         $update = [
             'status' => 25,
-            'video_time' => $nowtime,
+            'video_time' => time(),
         ];
 
         $update_rs = Db::name('wenzhen_order')->where('id',$order_id)->where('status',20)->update($update);
@@ -392,7 +410,19 @@ class Wenzhen extends Apic
             $this->error('操作失败');
         }
 
-        $this->success('操作成功');
+        //倒计时
+        $minute = config('site.firstvideo_videoorder_autofinish_minute');
+        if($wenzhen_order['comefrom'] == 2){
+            $minute = config('site.tv_firstvideo_videoorder_autofinish_minute');
+        }
+
+        $rs = [
+            'video_time'    => $update['video_time'],
+            'seconds'       => $minute*60,
+            'video_endtime' => $update['video_time'] + $minute*60,
+        ];
+
+        $this->success('操作成功',$rs);
     }
 
     //完成

+ 1 - 1
application/api/controller/tvuser/Baseconfig.php

@@ -26,7 +26,7 @@ class Baseconfig extends Api
         //本来应该放在盒子api的基础配置,从jiankang_tv的版本库,api/index/indexdata里复制出来的
         $config['vip']        = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home/vip.webp'; //vip图标
         $config['free']       = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home/free.webp';//免费图标
-        $config['leftbottom'] = '内容如有侵权,请联系删除'; //视频详情页,版权说明
+        $config['leftbottom'] = config('site.tv_videoinfo_banquan'); //视频详情页,版权说明
         $config['beian']['top']    = ''; //屏幕上面显示的备案
         $config['beian']['bottom'] = ''; //屏幕下面显示的备案
 

+ 1 - 0
application/extra/site.php

@@ -113,4 +113,5 @@ return array (
 小屏上传图片',
   'tv_wenzhen_month_times' => '1',
   'tv_firstvideo_videoorder_autofinish_minute' => '3',
+  'tv_videoinfo_banquan' => '内容如有侵权,请联系删除',
 );