wupengfei 2 years ago
parent
commit
1ac1e548d0
2 changed files with 6 additions and 2 deletions
  1. 1 1
      .idea/workspace.xml
  2. 5 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="5428000" />
+      <workItem from="1666313182769" duration="5517000" />
     </task>
     <servers />
   </component>

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

@@ -598,11 +598,15 @@ class Press extends Base
         $sel_where[]  = ['t.coll_type','=',4];
         $list = UserCollect::where($sel_where)
             ->alias('t')
-            ->field('t.id,t.create_at,t.coll_id press_id,i.title,i.cover')
+            ->field('t.id,t.create_at,t.coll_id press_id,i.title,i.cover,images')
             ->leftJoin('Press i','t.coll_id = i.id')
             ->order('id 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;
+        }
         $this->success('ok',['list'=>$list]);
     }