wupengfei 2 年之前
父節點
當前提交
b4d5701580
共有 3 個文件被更改,包括 47 次插入2 次删除
  1. 2 1
      .idea/workspace.xml
  2. 2 1
      application/api/controller/Article.php
  3. 43 0
      application/api/controller/Video.php

+ 2 - 1
.idea/workspace.xml

@@ -4,6 +4,7 @@
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/Article.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Article.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Video.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Video.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -220,7 +221,7 @@
       <workItem from="1664498426748" duration="13957000" />
       <workItem from="1665189429149" duration="5358000" />
       <workItem from="1665206979508" duration="7749000" />
-      <workItem from="1665276346161" duration="13618000" />
+      <workItem from="1665276346161" duration="15120000" />
     </task>
     <servers />
   </component>

+ 2 - 1
application/api/controller/Article.php

@@ -651,7 +651,7 @@ class Article extends Base
      * @desc
      * @author qc
      * @method
-     * @url /api/Article/needLogin()
+     * @url /api/Article/learn()
      */
     public function learn(){}
 
@@ -675,6 +675,7 @@ class Article extends Base
     {
         $sel_where  = [];
         $sel_where[]  = ['t.user_id','=',$this->user_id];
+        $sel_where[]  = ['t.type','=',3];
         $title = input('get.title');
         if($title)  $sel_where[]  = ['i.title','like','%'.$title.'%'];
         $list = UserTrack::where($sel_where)

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

@@ -781,7 +781,50 @@ class Video extends Base
     }
 
 
+    /**
+     * @title 以下接口学习服务模块的
+     * @desc
+     * @author qc
+     * @method
+     * @url /api/Video/learn()
+     */
+    public function learn(){}
 
+    /**
+     * @title 图文学习历史
+     * @desc 图文学习历史
+     * @author qc
+     * @method GET
+     * @url /api/Video/getLearnHistory
+     * @header name:Authorization require:1 desc:Token
+     * @param  name:title type:string default:-- desc:标题
+     * @param  name:page type:int default:0 desc:页数
+     * @param  name:page_num type:int default:20 desc:每页数
+     * @return name:title type:string default:-- desc:标题
+     * @return name:video_id type:string default:-- desc:视频id
+     * @return name:url_id type:string default:-- desc:url_id
+     * @return name:cover type:string default:-- desc:封面
+     * @return name:time type:string default:-- desc:时间
+     */
+    public function getLearnHistory()
+    {
+        $sel_where  = [];
+        $sel_where[]  = ['t.user_id','=',$this->user_id];
+        $sel_where[]  = ['t.type','=',1];
+        $title = input('get.title');
+        if($title)  $sel_where[]  = ['i.title','like','%'.$title.'%'];
+        $list = UserTrack::where($sel_where)
+            ->alias('t')
+            ->field('t.id,t.update_int,t.first_id video_id,t.second_id url_id,i.title,i.cover,i.ali_vid')
+            ->leftJoin('VideoUrl i','t.second_id = i.id')
+            ->order('update_int desc')
+            ->limit($this->off_set,$this->page_num)
+            ->select()->toArray();
+        foreach ($list as &$v) {
+            $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
+        }
+        $this->success('ok',['list'=>$list]);
+    }
 
 
 }