wupengfei 2 年之前
父节点
当前提交
0b9a44acae
共有 2 个文件被更改,包括 16 次插入8 次删除
  1. 5 5
      .idea/workspace.xml
  2. 11 3
      application/api/controller/Article.php

+ 5 - 5
.idea/workspace.xml

@@ -3,7 +3,7 @@
   <component name="ChangeListManager">
     <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/nutrition/controller/Learn.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/nutrition/controller/Learn.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Article.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Article.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -123,7 +123,7 @@
   <component name="PropertiesComponent">
     <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/application/common/service" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../sp" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -253,7 +253,7 @@
       <workItem from="1678236784872" duration="19064000" />
       <workItem from="1678322422199" duration="23277000" />
       <workItem from="1678410737283" duration="21226000" />
-      <workItem from="1678495559564" duration="4345000" />
+      <workItem from="1678495559564" duration="7745000" />
     </task>
     <servers />
   </component>
@@ -387,10 +387,10 @@
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
     <state x="283" y="145" width="1942" height="1088" key="DiffContextDialog/0.0.2560.1400@0.0.2560.1400" timestamp="1676355565535" />
-    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1678251857373">
+    <state x="1418" y="514" key="FileChooserDialogImpl" timestamp="1678502565986">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>
-    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1678251857373" />
+    <state x="1418" y="514" key="FileChooserDialogImpl/0.0.2560.1400@0.0.2560.1400" timestamp="1678502565986" />
     <state x="1051" y="472" key="MultipleFileMergeDialog" timestamp="1671416392056">
       <screen x="0" y="0" width="2560" height="1400" />
     </state>

+ 11 - 3
application/api/controller/Article.php

@@ -765,11 +765,13 @@ class Article extends Base
      * @param  name:page_num type:int default:20 desc:每页数
      * @return name:title type:string default:-- desc:标题
      * @return name:desc type:string default:-- desc:简介
-     * @return name:images type:string default:-- desc:图文【多张|隔开】
+     * @return name:images type:string default:-- desc:图片【多张|隔开】
+     * @return name:images_arr type:array default:-- desc:图片数组
      * @return name:status type:int default:-- desc:0待审核1审核通过2审核未通过
      * @return name:remark type:string default:-- desc:审核备注
      * @return name:create_at type:string default:-- desc:时间
      * @return name:label_name type:array default:-- desc:标签
+     * @return name:cover type:string default:-- desc:封面
      */
     public function getMyArticleList()
     {
@@ -785,6 +787,7 @@ class Article extends Base
             ->select()->toArray();
         array_map(function (&$v){
             $v['label_name'] =$v['label'] ?  explode(',',trim($v['label'],',')) :null;
+            $v['images_arr'] = $v['images'] ? explode('|',$v['images']):null;
         },$list);
         $total_num = UserArticle::where($sel_where)->count();
         $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
@@ -855,6 +858,8 @@ class Article extends Base
      * @return name:time type:string default:-- desc:时间
      * @return name:read_num type:int default:-- desc:阅读量
      * @return name:is_normal type:int default:-- desc:是否是正常记录(0已删除或是已禁用1可以正常跳转详情)
+     * @return name:app_name type:string default:-- desc:发布者
+     * @return name:app_logo type:string default:-- desc:发布者头像
      */
     public function getLearnHistory()
     {
@@ -865,7 +870,7 @@ class Article extends Base
         if($title)  $sel_where[]  = ['i.title|i.label','like','%'.$title.'%'];
         $list = UserTrack::where($sel_where)
             ->alias('t')
-            ->field('t.id,t.update_int,t.first_id article_id,t.second_id item_id,i.title,i.cover,i.read_num')
+            ->field('t.id,t.update_int,t.first_id article_id,t.second_id item_id,i.title,i.cover,i.read_num,i.user_id')
             ->leftJoin('ArticleItem i','t.second_id = i.id')
             ->order('update_int desc')
             ->limit($this->off_set,$this->page_num)
@@ -874,6 +879,9 @@ class Article extends Base
             $v['read_num'] = numTransform($v['read_num']);
             $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
             $v['is_normal'] = CheckPower::checkModulesPower($v['article_id'],$v['item_id'],$this->request->controller());
+            $article_auth = ArticleItem::getArticleAuth($v['user_id'],APPNAME,APPLOGO);
+            $v['app_name'] = $article_auth['app_name'];
+            $v['app_logo'] = $article_auth['app_logo'];
         }
         $total_num = UserTrack::where($sel_where)->alias('t') ->leftJoin('ArticleItem i','t.second_id = i.id')->count();
         $this->success('ok',['list'=>$list,'total_count'=>$total_num,'page_num'=>$this->page_num]);
@@ -1309,7 +1317,7 @@ class Article extends Base
         if($title)  $sel_where[]  = ['title|label','like','%'.$title.'%'];
         $list = ArticleItem::where($sel_where)
             ->alias('t')
-            ->field('id,title,cover,read_num,label,is_vip,article_id')
+            ->field('id,title,cover,read_num,label,is_vip,article_id,create_at')
             ->order('id desc')
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();