<?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 app\dice\helper\AdminScopeHelper;
use app\dice\model\reward_config\DiceRewardConfig;
use app\dice\logic\reward_config\DiceRewardConfigLogic;

$deptId = 1123;
$query = (new DiceRewardConfig())->order('id', 'asc');
AdminScopeHelper::applyConfigScope($query, null, $deptId);
$logic = new DiceRewardConfigLogic();
$result = $logic->getList($query);
echo 'keys: ' . implode(',', array_keys($result)) . "\n";
$data = $result['data'] ?? $result['records'] ?? [];
echo 'count: ' . (is_array($data) ? count($data) : 0) . "\n";
