| 12345678910111213141516171819 |
- <?php
- require dirname(__DIR__) . '/vendor/autoload.php';
- \Dotenv\Dotenv::createUnsafeMutable(dirname(__DIR__))->load();
- \support\App::loadAllConfig(['route']);
- \Webman\ThinkOrm\ThinkOrm::start(null);
- use support\think\Db;
- $tables = Db::query('SHOW TABLES');
- foreach ($tables as $record) {
- $table = array_values($record)[0];
- if (!preg_match('/^[a-zA-Z0-9_]+$/D',$table)) continue;
- echo $table.' '.Db::table($table)->count()."\n";
- }
- foreach (['sa_system_user','sa_agent_profile','sa_agent_contract'] as $table) {
- if (!in_array($table,array_map(fn($r)=>array_values($r)[0],$tables),true)) continue;
- echo "COLUMNS $table\n";
- foreach (Db::query('SHOW COLUMNS FROM `'.$table.'`') as $column) echo $column['Field'].' '.$column['Type']."\n";
- }
- echo "MENUS\n";
- foreach (Db::table('sa_system_menu')->where('type','<>',3)->field('id,parent_id,code,path,component')->select()->toArray() as $menu) echo json_encode($menu,JSON_UNESCAPED_UNICODE)."\n";
|