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); } /**