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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user