Merge branch 'master' into develop

# Conflicts:
#	app/common/utils/WsEvents.php
#	app/controller/IndexController.php
This commit is contained in:
mzl
2025-10-12 17:40:37 +08:00
parent c8ca4e0d28
commit 4376c668ba
3 changed files with 28 additions and 9 deletions
+20 -6
View File
@@ -99,18 +99,32 @@ class IndexController
return $result;
}
/**
* 菜单迁移
*/
public function doMenu()
{
// 菜单迁移 (部分)
$where[] = ['id', '>', 239];
(new \app\common\utils\MigrationResources())->do('resources', 'resources_20251012_bak', $where);
// 整体
// $list = (new \app\common\utils\MigrationResources())->getFullResourceTreeOptimized('resources_20250916_bak', []);
// var_dump($list);
}
public function test(Request $request)
{
// $chain = \app\common\service\MenuBadgeService::buildBadgeChain(menuId: 226, leafCount: rand(1, 10));
// (new \app\common\utils\WsEvents())->pushWebsocket('approval.todo.counts', 74, $chain);
$data = [
'event' => 'approval.todo.counts',
'user_id' => 74,
'num' => rand(1, 10),
];
\Webman\RedisQueue\Redis::send('ws-msg', $data);
// $data = [
// 'event' => 'approval.todo.counts',
// 'user_id' => 74,
// 'num' => rand(1, 10),
// ];
// \Webman\RedisQueue\Redis::send('ws-msg', $data);
return json(['code' => 0, 'msg' => 'success']);
}