ps_factory_perms_run.php 578 B

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