合并auth
This commit is contained in:
commit
d46d91f2ac
10 files changed
+304
-15
No files matched your search
+5
-3
@@ -3,7 +3,7 @@
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class KaoshiUp extends Migrator
|
||||
class KaoshiAddUser extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
@@ -32,8 +32,9 @@ class KaoshiUp extends Migrator
|
||||
$table = $this->table('kaoshi');
|
||||
|
||||
$table
|
||||
->addColumn('user_id','integer',['after' => 'category_id', 'limit'=>11,'default'=>0,'null'=>false,'comment'=>'用户ID'])
|
||||
->addColumn('user_group','string',['after' => 'user_id', 'limit'=>25,'default'=>'admin','null'=>false,'comment'=>'用户组'])
|
||||
->addColumn('user_id','integer',['after' => 'category_id','limit'=>11,'default'=>0,'null'=>false,'comment'=>'用户ID'])
|
||||
->addColumn('user_group','string',['after' => 'user_id','limit'=>25,'default'=>'a','null'=>false,'comment'=>'用户组'])
|
||||
->addColumn('jibie_id','integer',['after' => 'user_group','limit'=>11,'default'=>1,'null'=>false,'comment'=>'级别ID'])
|
||||
->update();
|
||||
}
|
||||
|
||||
@@ -46,6 +47,7 @@ class KaoshiUp extends Migrator
|
||||
$table
|
||||
->removeColumn('user_id')
|
||||
->removeColumn('user_group')
|
||||
->removeColumn('jibie_id')
|
||||
->update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Migrator;
|
||||
use think\migration\db\Column;
|
||||
|
||||
class RuleAddsystemreset extends Migrator
|
||||
{
|
||||
/**
|
||||
* Change Method.
|
||||
*
|
||||
* Write your reversible migrations using this method.
|
||||
*
|
||||
* More information on writing migrations is available here:
|
||||
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
||||
*
|
||||
* The following commands can be used in this method and Phinx will
|
||||
* automatically reverse them when rolling back:
|
||||
*
|
||||
* createTable
|
||||
* renameTable
|
||||
* addColumn
|
||||
* renameColumn
|
||||
* addIndex
|
||||
* addForeignKey
|
||||
*
|
||||
* Remember to call "create()" or "update()" and NOT "save()" when working
|
||||
* with the Table class.
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
$singleRow = [
|
||||
['id' => 70502
|
||||
,'title' => '初始化'
|
||||
,'name' => 'system/systembase/resetmayi'
|
||||
,'paixu' => 2
|
||||
,'pid' => 705
|
||||
],
|
||||
];
|
||||
|
||||
// this is a handy shortcut
|
||||
$this->insert('auth_rule', $singleRow);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->execute('DELETE FROM cj_auth_rule where id=707');
|
||||
}
|
||||
}
|
||||
@@ -1232,6 +1232,13 @@ class Rule extends Seeder
|
||||
,'paixu' => 1
|
||||
,'pid' => 705
|
||||
],
|
||||
// // 下次要添加上
|
||||
// ['id' => 70502
|
||||
// ,'title' => '初始化'
|
||||
// ,'name' => 'system/systembase/resetmayi'
|
||||
// ,'paixu' => 2
|
||||
// ,'pid' => 705
|
||||
// ],
|
||||
['id' => 706
|
||||
,'title' => '统计项目'
|
||||
,'name' => 'kaoshi/tongjixiangmu/index'
|
||||
@@ -1283,6 +1290,7 @@ class Rule extends Seeder
|
||||
,'pid' => 706
|
||||
],
|
||||
|
||||
|
||||
/*======================================================================
|
||||
* 考试管理
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user