Files
dafuweng-saiadmin6.x/server/db/test_reward_config_list.php
2026-05-26 09:43:42 +08:00

21 lines
799 B
PHP

<?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";