wupengfei 2 vuotta sitten
vanhempi
commit
55657f3182
2 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 1 1
      .idea/workspace.xml
  2. 2 0
      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="5223000" />
+      <workItem from="1666313182769" duration="5282000" />
     </task>
     <servers />
   </component>

+ 2 - 0
application/api/controller/Press.php

@@ -505,6 +505,7 @@ class Press extends Base
             ->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]);
 
@@ -554,6 +555,7 @@ class Press extends Base
             $v['user_name'] = $user_info['name'];
             $v['headimg'] = $user_info['headimg'];
             $v['images_arr'] = $v['images'] ? explode('|',$v['images']) : null;
+            $v['cover'] =   $v['images_arr'] ? $v['images_arr'][0] : null;
             $parent_comment = PressComment::where([['t.id','=',$v['pid']]])
                 ->field('t.id,t.first_id press_id,t.content,i.title,i.cover,i.images,t.pid,u.name')
                 ->alias('t')