From 58f1ad14ac46c4e677bbd08b8a961f53ad4d35da Mon Sep 17 00:00:00 2001 From: Devil Date: Fri, 23 Jul 2021 19:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=95=B0=E6=8D=AE=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/PluginsAdminService.php | 6 +++++- app/service/PluginsService.php | 9 +++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/service/PluginsAdminService.php b/app/service/PluginsAdminService.php index 5543c9c33..0a2722648 100755 --- a/app/service/PluginsAdminService.php +++ b/app/service/PluginsAdminService.php @@ -1427,7 +1427,11 @@ php; $sql_file = APP_PATH.'plugins'.DS.$plugins.DS.'update.sql'; if(!empty($plugins) && file_exists($sql_file)) { - SqlconsoleService::Implement(['sql'=>file_get_contents($sql_file)]); + $sql = file_get_contents($sql_file); + if(!empty($sql)) + { + SqlconsoleService::Implement(['sql'=>$sql]); + } } // 钩子部署 diff --git a/app/service/PluginsService.php b/app/service/PluginsService.php index c2afa9293..7e9405b58 100755 --- a/app/service/PluginsService.php +++ b/app/service/PluginsService.php @@ -37,11 +37,9 @@ class PluginsService */ public static function PluginsData($plugins, $attachment_field = [], $is_cache = true) { - // 从缓存获取数据 + // 从缓存获取数据、数据不存在则从数据库读取 $data = ($is_cache === true) ? self::PluginsCacheData($plugins) : []; - - // 数据不存在则从数据库读取 - if($data === null) + if($data === null || !$is_cache) { // 获取数据 $ret = self::PluginsField($plugins, 'data'); @@ -204,8 +202,7 @@ class PluginsService */ public static function PluginsCacheData($plugins) { - $data = MyCache(MyConfig('shopxo.cache_plugins_data_key').$plugins); - return empty($data) ? '' : $data; + return MyCache(MyConfig('shopxo.cache_plugins_data_key').$plugins); } /**