xielin 5 년 전
부모
커밋
18fdb69b91
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/Models/InterestCircleMessage.php
  2. 1 1
      app/Transformers/Circle/MessageListTransformer.php

+ 1 - 1
app/Models/InterestCircleMessage.php

@@ -19,7 +19,7 @@ class InterestCircleMessage extends Model
 
     public function imgs()
     {
-        return $this->hasMany('App\Models\InterestCircleMessageImg', 'circle_id', 'id');
+        return $this->hasMany('App\Models\InterestCircleMessageImg', 'msg_id', 'id');
     }
 
 }

+ 1 - 1
app/Transformers/Circle/MessageListTransformer.php

@@ -34,7 +34,7 @@ class MessageListTransformer extends TransformerAbstract
         $user = $this->userInfo($interestCircleMessage['uid']);
         $imgs = [];
         foreach ($interestCircleMessage->imgs as $img) {
-            $imgs[] = $img['img'];
+            $imgs[] = $img['image'];
         }
         return [
             'id' => $interestCircleMessage['id'],