修改表结构
This commit is contained in:
1 parent
26337e7390
commit
54ad7ff87c
21 files changed
+746
-61
No files matched your search
@@ -35,7 +35,7 @@ class Banji extends Migrator
|
||||
$table
|
||||
->addColumn('school_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学校'])
|
||||
->addColumn('ruxuenian','integer',['limit'=>4,'null'=>true,'comment'=>'入学年'])
|
||||
->addColumn('xuanduan_id','integer',['limit'=>11,'null'=>true,'comment'=>'学段'])
|
||||
->addColumn('xueduan_id','integer',['limit'=>11,'null'=>true,'comment'=>'学段'])
|
||||
->addColumn('paixu','integer',['limit'=>3,'default'=>'100','null'=>false,'comment'=>'排序'])
|
||||
->addColumn('alias','string',['limit'=>24,'default'=>null,'null'=>true,'comment'=>'班级别名'])
|
||||
->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间'])
|
||||
|
||||
@@ -34,6 +34,7 @@ class Chengji extends Migrator
|
||||
// 添加当前表字段
|
||||
$table
|
||||
->addColumn('kaohao_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'考试'])
|
||||
->addColumn('user_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'录入'])
|
||||
->addColumn('subject_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学科'])
|
||||
->addColumn('defen','decimal',['precision'=>5,'scale'=>1,'default'=>Null,'null'=>false,'comment'=>'得分'])
|
||||
->addColumn('defenlv','decimal',['precision'=>6,'scale'=>2,'default'=>Null,'null'=>false,'comment'=>'得分率'])
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Loaded 3 of 21 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user