From e96a81d00e080cc0c8eb984505a13dd8d1123af2 Mon Sep 17 00:00:00 2001 From: gongfuxiang <2499232802@qq.com> Date: Sat, 29 Dec 2018 00:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=99=84=E4=BB=B6=E8=A2=AB=E8=A6=86=E7=9B=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/service/ConfigService.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/application/service/ConfigService.php b/application/service/ConfigService.php index b9e239265..886d2d0d5 100755 --- a/application/service/ConfigService.php +++ b/application/service/ConfigService.php @@ -55,6 +55,17 @@ class ConfigService // 附件 $data_fields = ['home_site_logo', 'home_site_logo_wap', 'home_site_desktop_icon']; + + // 当前参数中不存在则移除 + foreach($data_fields as $key=>$field) + { + if(!isset($params[$field])) + { + unset($data_fields[$key]); + } + } + + // 获取附件 $attachment = ResourcesService::AttachmentParams($params, $data_fields); foreach($attachment['data'] as $k=>$v) {