lizhen_gitee hai 8 meses
pai
achega
a7912c5f8b
Modificáronse 1 ficheiros con 8 adicións e 8 borrados
  1. 8 8
      application/api/controller/Tvindex.php

+ 8 - 8
application/api/controller/Tvindex.php

@@ -132,8 +132,8 @@ class Tvindex extends Api
         }
 
         $info['image'] = one_domain_image($info['image']);
-        $info['is_collection'] = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
-        $info['is_good']       = Db::name('video_good')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
+        $info['is_collection'] = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $info['id']])->count('id');
+        $info['is_good']       = Db::name('video_good')->where(['user_id' => $this->auth->id, 'video_id' => $info['id']])->count('id');
 
         //剧集列表
         $juji = [];
@@ -161,7 +161,7 @@ class Tvindex extends Api
         if($this->auth->isLogin()){
             $view_map = [
                 'user_id'  => $this->auth->id,
-                'video_id' => $id,
+                'video_id' => $info['id'],
             ];
             $check_view = Db::name('video_view')->where($view_map)->find();
             if($check_view){
@@ -174,7 +174,7 @@ class Tvindex extends Api
         }
 
         //记录pv,uv
-        $this->video_pvuv($id);
+        $this->video_pvuv($info['id']);
 
         //
         $result = [
@@ -205,14 +205,14 @@ class Tvindex extends Api
         }
 
         $info['image'] = one_domain_image($info['image']);
-        $info['is_collection'] = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
-        $info['is_good']       = Db::name('video_good')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
+        $info['is_collection'] = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $info['id']])->count('id');
+        $info['is_good']       = Db::name('video_good')->where(['user_id' => $this->auth->id, 'video_id' => $info['id']])->count('id');
 
         //记录浏览历史,给浏览历史列表用的,即时的
         if($this->auth->isLogin()){
             $view_map = [
                 'user_id'  => $this->auth->id,
-                'video_id' => $id,
+                'video_id' => $info['id'],
             ];
             $check_view = Db::name('video_view')->where($view_map)->find();
             if($check_view){
@@ -225,7 +225,7 @@ class Tvindex extends Api
         }
 
         //记录pv,uv
-        $this->video_pvuv($id);
+        $this->video_pvuv($info['id']);
 
         //
         $result = [