wupengfei 2 years ago
parent
commit
72be6cd429
2 changed files with 5 additions and 3 deletions
  1. 2 2
      .idea/workspace.xml
  2. 3 1
      application/api/controller/Press.php

+ 2 - 2
.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$/public/dist/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/dist/index.html" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Press.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Press.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -206,7 +206,7 @@
       <workItem from="1671755452818" duration="9153000" />
       <workItem from="1671843798040" duration="608000" />
       <workItem from="1672014482595" duration="6611000" />
-      <workItem from="1672102740019" duration="2009000" />
+      <workItem from="1672102740019" duration="2780000" />
     </task>
     <servers />
   </component>

+ 3 - 1
application/api/controller/Press.php

@@ -543,13 +543,15 @@ class Press extends Base
         $sel_where[]  = ['i.user_id','=',$this->user_id];
         $list = PressComment::where($sel_where)
             ->alias('t')
-            ->field('t.id,t.is_read,t.create_at,t.first_id press_id,t.content,i.title,i.cover,u.name user_name,u.headimg')
+            ->field('t.id,t.is_read,t.create_at,t.first_id press_id,t.content,i.images,i.title,i.cover,u.name user_name,u.headimg')
             ->leftJoin('Press i','t.first_id = i.id')
             ->leftJoin('store_member u','t.user_id = u.id')
             ->order('t.id desc')
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
         array_walk($list,function (&$v){
+            $v['images_arr'] = $v['images'] ? explode('|',$v['images']) : null;
+            $v['cover'] =   $v['images_arr'] ? $v['images_arr'][0] : null;
             $v['is_normal'] = CheckPower::checkModulesPower($v['press_id'],0,$this->request->controller());
         });
         $this->success('ok',['list'=>$list]);