mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-11-30 02:49:03 +08:00
插件数据优化
This commit is contained in:
parent
c112313962
commit
58f1ad14ac
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
// 钩子部署
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user