DB数据库文件

This commit is contained in:
2026-05-26 09:43:42 +08:00
parent e0b303c5d4
commit a4c8f623be
30 changed files with 1416 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?php
/**
* 为各渠道补齐三个默认代理角色,并清理多余角色(无用户绑定的)
* 用法: php db/sync_channel_default_roles.php
*/
declare(strict_types=1);
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../support/bootstrap.php';
use plugin\saiadmin\app\service\SystemRoleChannelService;
$service = new SystemRoleChannelService();
echo 'Default role codes: ' . implode(', ', $service->getDefaultChannelRoleCodes()) . "\n";
$sync = $service->syncAllChannelsFromDefault();
echo json_encode($sync, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) . "\n";
$mapped = $service->remapUserRolesToChannelRoles();
echo "Remapped user roles: {$mapped}\n";
echo "Done.\n";