<?php
declare(strict_types=1);
define('BASE_PATH', dirname(__DIR__));
require 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 support\think\Db;
$depts = Db::table('sa_system_dept')->column('id');
array_unshift($depts, 0);
foreach ($depts as $d) {
    $c = Db::table('dice_reward_config')->where('dept_id', $d)->count();
    $r = Db::table('dice_reward')->where('dept_id', $d)->count();
    $nonBig = Db::table('dice_reward_config')->where('dept_id', $d)->where('tier', '<>', 'BIGWIN')->count();
    echo "dept {$d}: reward_config={$c}, non_bigwin={$nonBig}, reward={$r}\n";
}
