Przeglądaj źródła

三个播放统计数据

lizhen_gitee 9 miesięcy temu
rodzic
commit
80772f2fc8
1 zmienionych plików z 42 dodań i 0 usunięć
  1. 42 0
      application/api/controller/Tvindex.php

+ 42 - 0
application/api/controller/Tvindex.php

@@ -449,6 +449,19 @@ class Tvindex extends Api
             $this->error('数据不存在');
         }
 
+        //播放日志
+        $play_data = [
+            'user_id' => $this->auth->id,
+            'video_id' => $id,
+            'sn' => $sn,
+            'start_time' => $start_time,
+            'end_time' => $end_time,
+            'csource' => $csource,
+            'createtime' => time(),
+            'updatetime' => time(),
+        ];
+        Db::name('video_play_payuserplay')->insertGetId($play_data);
+
         $content = [
             'UserID' => $this->auth->mobile,
             'city' => '14',
@@ -498,6 +511,19 @@ class Tvindex extends Api
             $this->error('视频丢失');
         }
 
+        //播放日志
+        $play_data = [
+            'user_id' => $this->auth->id,
+            'video_id' => $id,
+            'total_time' => $total_time,
+            'start_time' => $start_time,
+            'end_time' => $end_time,
+            'log_type' => $log_type,
+            'createtime' => time(),
+            'updatetime' => time(),
+        ];
+        Db::name('video_play_playrecord')->insertGetId($play_data);
+
         $info['image'] = one_domain_image($info['image']);
 
         $url = 'http://meta-history.unso.gitv.tv/OTT/jscmcc/addThirdPartyHistoryRecord';
@@ -572,6 +598,22 @@ class Tvindex extends Api
             $this->error('数据不存在');
         }
 
+        //播放日志
+        $play_data = [
+            'user_id' => $this->auth->id,
+            'video_id' => $id,
+            'sn' => $sn,
+            'start_time' => $start_time,
+            'end_time' => $end_time,
+            'csource' => $csource,
+            'trace_id' => $trace_id,
+            'istry' => $istry,
+            'start_posi' => $start_posi,
+            'createtime' => time(),
+            'updatetime' => time(),
+        ];
+        Db::name('video_play_userplay')->insertGetId($play_data);
+
         $content = [
             'playid' => (string)(config('data_cp_id') . date('Ymd') . getMillisecond() . mt_rand(10000000, 99999999)),
             'UserID' => $this->auth->mobile,