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; }