From 71c72d0062089e34e813274fb1ca3a54da2a4d38 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Mon, 23 Sep 2024 17:12:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/BusinessSchoolLogic.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/api/logic/BusinessSchoolLogic.php b/app/api/logic/BusinessSchoolLogic.php index 11f83706..0ac5e693 100644 --- a/app/api/logic/BusinessSchoolLogic.php +++ b/app/api/logic/BusinessSchoolLogic.php @@ -83,7 +83,14 @@ class BusinessSchoolLogic extends Logic $article = []; }else{ $article = $article->toArray(); - $article['file'] = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + $file = BusinessSchoolFile::where('bsid', $id)->select()->toArray(); + foreach ($file as &$v) { + if ($v['type'] == 1) { + $article['image'][] = $v['src']; + } else if($v['type'] == 2) { + $article['file'][] = $v['src']; + } + } } return $article; }