From e53e93d9fe9e6e2ddf97b3a80042d6ccb313b658 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Tue, 8 Jul 2025 14:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8B=E5=8F=8B=E5=9C=88=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=88=9B=E5=BB=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/enterprise/model/Posts.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/enterprise/model/Posts.php b/app/enterprise/model/Posts.php index 0d9ef40..d248a52 100644 --- a/app/enterprise/model/Posts.php +++ b/app/enterprise/model/Posts.php @@ -11,11 +11,11 @@ class Posts extends BaseModel // 创建朋友圈头像 public static function createAvatar($posts_id) { - $PostsFile = PostsFile::where(['posts_id' => $posts_id])->field('file_id')->select(); + $PostsFile = PostsFile::where(['posts_id' => $posts_id])->field('file_id')->select()->toArray(); if (count($PostsFile) > 1) { - $imgFileIdArr = array_column($PostsFile, 'file_id'); $imgFileArr = []; - foreach ($imgFileIdArr as $file_id) { + foreach ($PostsFile as $value) { + $file_id = $value['file_id']; $src = File::where('file_id', '=', $file_id)->value('src'); if ($src) { $imgFileArr[] = $src;