refactor(admin): optimize log data processing and display

- Update log data serialization and deserialization method
- Improve log data display format in the admin interface- Refactor log model initialization and table suffix handling
- Optimize time model configuration for better timestamp management
This commit is contained in:
wolfcode
2025-03-25 18:08:35 +08:00
parent fc202be987
commit 12b38c7bf5
18 changed files with 214 additions and 108 deletions

View File

@@ -7,22 +7,21 @@ use app\common\model\TimeModel;
class SystemNode extends TimeModel
{
public function getNodeTreeList()
public function getNodeTreeList(): array
{
$list = $this->select()->toArray();
$list = $this->buildNodeTree($list);
return $list;
$list = $this->removeOption('where')->select()->toArray();
return $this->buildNodeTree($list);
}
protected function buildNodeTree($list)
protected function buildNodeTree($list): array
{
$newList = [];
$newList = [];
$repeatString = "      ";
foreach ($list as $vo) {
if ($vo['type'] == 1) {
$newList[] = $vo;
foreach ($list as $v) {
if ($v['type'] == 2 && strpos($v['node'], $vo['node'] . '/') !== false) {
if ($v['type'] == 2 && str_contains($v['node'], $vo['node'] . '/')) {
$v['node'] = "{$repeatString}{$repeatString}" . $v['node'];
$newList[] = $v;
}