Merge branch 'develop'

This commit is contained in:
mzl
2025-09-18 15:05:57 +08:00
parent 5fef15b0fa
commit b7b6edb06c
46 changed files with 522 additions and 1512 deletions
+4 -49
View File
@@ -98,58 +98,13 @@ class IndexController
}
public function test2(Request $request)
{
$where[] = ['id', '>', 141];
$list = (new \app\common\utils\MigrationResources())->getFullResourceTreeOptimized('resources', $where);
$keys = ['system_id','name','desc','type','code','parent_id','url','icon','open_type','link',
'is_hide','is_hide_tab','no_auth','is_home','instance','keep_alive','sort','status'];
foreach ($list as $key=>$item) {
$temp = [];
foreach ($item as $k=>$v) {
if (isset($item['children']) && count($item['children']) > 0) {
$temp = $item['children'];
}
if (!in_array($k, $keys)) {
unset($item[$k]);
}
$id = Db::table('resources')->insertGetId($item);
if ($temp) {
foreach ($temp as $kc=>$vc) {
foreach ($vc as $kk => $vv) {
if (!in_array($kk, $keys)) {
unset($vc[$kk]);
}
}
$vc['parent_id'] = $id;
Db::table('resources')->insert($vc);
}
}
}
}
}
public function test(Request $request)
{
// 菜单迁移
$where[] = ['id', '>', 141];
$list = (new \app\common\utils\MigrationResources())->do('resources_20250916_bak', 'resources_yuanshi', $where);
// $where[] = ['id', '>', 141];
// $list = (new \app\common\utils\MigrationResources())->do('resources_20250916_bak', 'resources_yuanshi', $where);
$list = (new \app\common\utils\MigrationResources())->getFullResourceTreeOptimized('resources_20250916_bak', []);
var_dump($list);
}
}