修改表结构

This commit is contained in:
小松树 committed 2020-12-24 16:38:16 +08:00
1 parent 26337e7390
commit 54ad7ff87c
21 files changed
+746 -61

No files matched your search

+35
View File
@@ -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();
}
}
+51
View File
@@ -0,0 +1,51 @@
<?php
use think\migration\Seeder;
class Banji 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()
{
$y = date('Y');
$m = date('m');
if ($m>=8)
{
$ruxuenian = $y;
} else {
$ruxuenian = $y - 1;
}
// 设置数据
$rows= [
[
'school_id' => 2
,'ruxuenian' => $ruxuenian
,'paixu' => 1
]
,[
'school_id' => 2
,'ruxuenian' => $ruxuenian
,'paixu' => 2
]
,[
'school_id' => 2
,'ruxuenian' => $ruxuenian
,'paixu' => 3
]
];
// 保存数据
$this->table('banji')->insert($rows)->save();
}
}
+2
View File
@@ -294,6 +294,8 @@ class Category extends Seeder
['id' => 12208,'title' => '教师-各学生-网页','p_id' => 122,'paixu' => 8,'isupdate' => 0],
['id' => 12209,'title' => '学生-各考试-网页','p_id' => 122,'paixu' => 9,'isupdate' => 0],
['id' => 12210,'title' => '管理员-学生-下载左','p_id' => 122,'paixu' => 10,'isupdate' => 0],
['id' => 12211,'title' => '管理员-各年级-网页','p_id' => 122,'paixu' => 11,'isupdate' => 0],
['id' => 12212,'title' => '管理员-各年级-下载','p_id' => 122,'paixu' => 12,'isupdate' => 0],
];
// 保存数据
Loaded 3 of 21 files, more files were not shown because too many files have changed in this diff. Show more