修改表结构
This commit is contained in:
1 parent
26337e7390
commit
54ad7ff87c
21 files changed
+746
-61
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class AuthGroup extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run Method.
|
||||
*
|
||||
* Write your database seeder using this method.
|
||||
*
|
||||
* More information on writing seeders is available here:
|
||||
* http://docs.phinx.org/en/latest/seeding.html
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$auth = new \app\admin\model\AuthRule;
|
||||
$authList = $auth
|
||||
->where('status', 1)
|
||||
->column('id');
|
||||
$authList = implode(',', $authList);
|
||||
|
||||
// 设置数据
|
||||
$rows= [
|
||||
[
|
||||
'title' => '管理员'
|
||||
,'rules' => $authList
|
||||
,'miaoshu' => '拥有所有权限'
|
||||
]
|
||||
];
|
||||
|
||||
// 保存数据
|
||||
$this->table('auth_group')->insert($rows)->save();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user