<?php
declare(strict_types=1);
define('BASE_PATH', dirname(__DIR__));
require_once BASE_PATH . '/vendor/autoload.php';
\Dotenv\Dotenv::createUnsafeMutable(BASE_PATH)->load();
\Webman\Config::load(BASE_PATH . '/config', ['route', 'plugin']);
\Webman\ThinkOrm\ThinkOrm::start(null);

use app\dice\service\DiceChannelConfigService;

$service = new DiceChannelConfigService();
echo "修复无效渠道引用...\n";
print_r($service->repairOrphanDeptReferences());
echo "\n回填 dept_id...\n";
print_r($service->backfillDataDeptId());
echo "完成。\n";
