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

+ 1 - 1
.idea/workspace.xml

@@ -170,7 +170,7 @@
       <workItem from="1666054299858" duration="23137000" />
       <workItem from="1666140525910" duration="23609000" />
       <workItem from="1666227349089" duration="7795000" />
-      <workItem from="1666313182769" duration="5569000" />
+      <workItem from="1666313182769" duration="5645000" />
     </task>
     <servers />
   </component>

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

@@ -674,12 +674,14 @@ class Press extends Base
         if($title)  $sel_where[]  = ['i.title','like','%'.$title.'%'];
         $list = UserTrack::where($sel_where)
             ->alias('t')
-            ->field('t.id,t.update_int,t.first_id press_id,i.title,i.cover')
+            ->field('t.id,t.update_int,t.first_id press_id,i.title,i.cover,i.images')
             ->leftJoin('Press i','t.first_id = i.id')
             ->order('update_int desc')
             ->limit($this->off_set,$this->page_num)
             ->select()->toArray();
         foreach ($list as &$v) {
+            $v['images_arr'] = $v['images'] ? explode('|',$v['images']) : null;
+            $v['cover'] =   $v['images_arr'] ? $v['images_arr'][0] : null;
             $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
         }
         $this->success('ok',['list'=>$list]);