mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
fix: 修复视图范围类组件处理变量时没有兼容null值的问题
This commit is contained in:
@@ -270,7 +270,7 @@ function event_handle_result($name, $key, $type = 'all', $params = []) : array
|
||||
}
|
||||
|
||||
/**
|
||||
* 字符拼接通用处理函数
|
||||
* 字符拼接通用处理函数.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
@@ -286,7 +286,7 @@ function event_handle_string($name, $type)
|
||||
|
||||
function event_view_content($name)
|
||||
{
|
||||
return event_handle_string($name, 'view_content');
|
||||
return event_handle_string($name, 'view_content');
|
||||
}
|
||||
|
||||
function event_view_replace($content, $name)
|
||||
@@ -418,3 +418,13 @@ if (!function_exists('get_site_version_key')) {
|
||||
return sysconfig('site', 'site_version') . '-' . Version::VERSION . '-' . Version::PRODUCT_VERSION . '-' . Version::LAYUI_VERSION;
|
||||
}
|
||||
}
|
||||
if (!function_exists('format_null_value')) {
|
||||
function format_null_value($value)
|
||||
{
|
||||
if (is_null($value)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ class Cx extends Taglib
|
||||
|
||||
if ('$' == $flag || ':' == $flag) {
|
||||
$value = $this->autoBuildVar($value);
|
||||
$str = 'is_array(' . $value . ')?' . $value . ':explode(\',\',' . $value . ')';
|
||||
$str = 'is_array(' . $value . ')?' . $value . ':explode(\',\',format_null_value(' . $value . '))';
|
||||
} else {
|
||||
$value = '"' . $value . '"';
|
||||
$str = 'explode(\',\',' . $value . ')';
|
||||
|
||||
Reference in New Issue
Block a user