DB数据库文件
This commit is contained in:
18
server/db/test_reward_config_scope.php
Normal file
18
server/db/test_reward_config_scope.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?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;
|
||||
|
||||
foreach ([0, 1123] as $deptId) {
|
||||
$q1 = DiceRewardConfig::where('dept_id', $deptId);
|
||||
echo "direct dept {$deptId}: " . $q1->count() . "\n";
|
||||
$q2 = (new DiceRewardConfig())->order('id', 'asc');
|
||||
AdminScopeHelper::applyConfigScope($q2, ['id' => 1], $deptId);
|
||||
echo "super admin scoped dept {$deptId}: " . $q2->count() . "\n";
|
||||
}
|
||||
Reference in New Issue
Block a user