Browse Source

视频模块

lizhen_gitee 10 months ago
parent
commit
e6a9f4902f
1 changed files with 19 additions and 0 deletions
  1. 19 0
      application/api/controller/Video.php

+ 19 - 0
application/api/controller/Video.php

@@ -47,6 +47,25 @@ class Video extends Api
         $this->success('success',$info);
     }
 
+    //评论列表
+    public function answer_list(){
+        $id = input('id',0);
+
+        $list = Db::name('video_answer')->alias('va')
+            ->field('va.info,va.createtime,user.nickname,user.avatar')
+            ->join('user','va.user_id = user.id','LEFT')
+            ->where('va.video_id',$id)
+            ->order('va.id desc')->autopage()->select();
+        if(!empty($list)){
+            foreach($list as $key => &$val){
+                $val['createtime'] = get_last_time($val['createtime']);
+                $val['avatar'] = localpath_to_netpath($val['avatar']);
+            }
+        }
+
+        $this->success(1,$list);
+    }
+
     //点赞
     public function good(){
         $id = input('id');