简化代码

pull/512/head
ken678 2025-09-23 15:28:46 +08:00
parent f804c8a460
commit c13b9eb147
1 changed files with 1 additions and 1 deletions

View File

@ -581,7 +581,7 @@ class Backend extends Controller
} else {
$result = array_intersect_key(($item instanceof Model ? $item->toArray() : (array)$item), array_flip($fields));
}
$result['pid'] = isset($item['pid']) ? $item['pid'] : (isset($item['parent_id']) ? $item['parent_id'] : 0);
$result['pid'] = (int)($item['pid'] ?? $item['parent_id'] ?? 0);
// 修改为安全的htmlentities调用兼容php8+版本
$result = array_map(function($value) {
return $value === null ? '' : htmlentities((string)$value);