| 123456789101112131415 |
- <?php
- $root = dirname(dirname(__DIR__));
- define('APP_PATH', $root . '/application/');
- require $root . '/thinkphp/base.php';
- \think\App::initCommon();
- $prefix = \think\Db::getConfig('prefix');
- $table = $prefix . 'user';
- $rows = \think\Db::query("SHOW COLUMNS FROM `{$table}` LIKE 'factory_perms'");
- if ($rows) {
- echo $table . ".factory_perms exists\n";
- } else {
- \think\Db::execute("ALTER TABLE `{$table}` ADD COLUMN `factory_perms` text NULL COMMENT '工厂端权限JSON,空=操作员默认全开' AFTER `factory_role`");
- echo $table . ".factory_perms added\n";
- }
|