From 2f3a653aa4a598fb9c1a4dae986674e1773a97b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Thu, 7 Jan 2021 16:15:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E8=A1=A8=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/kaoshi/controller/Index.php | 4 ++ .../migrations/20181010035225_system_base.php | 2 +- .../migrations/20181010075304_auth_group.php | 2 +- .../20181010075517_auth_group_access.php | 2 +- .../migrations/20181010075553_auth_rule.php | 2 +- database/migrations/20181012140355_member.php | 2 +- .../migrations/20181025041505_category.php | 2 +- database/migrations/20181026002455_school.php | 2 +- .../migrations/20181028023517_teacher.php | 2 +- database/migrations/20181028024920_xueqi.php | 2 +- database/migrations/20181028025648_kaoshi.php | 2 +- .../migrations/20181030024954_subject.php | 2 +- database/migrations/20181101040801_fields.php | 2 +- .../migrations/20181102003411_student.php | 2 +- database/migrations/20181102004156_banji.php | 2 +- database/migrations/20181114055804_kaohao.php | 2 +- .../migrations/20181218041034_dw_rongyu.php | 2 +- .../migrations/20181221041509_js_rongyu.php | 2 +- .../20181221041523_js_rongyu_info.php | 2 +- .../20181227061353_dw_rongyu_canyu.php | 2 +- .../20190214052203_js_rongyu_canyu.php | 2 +- database/migrations/20190218055858_keti.php | 2 +- .../migrations/20190222040223_keti_info.php | 2 +- .../migrations/20190222041040_keti_canyu.php | 2 +- .../migrations/20190430034853_chengji.php | 2 +- .../migrations/20200106013922_tongji_bj.php | 2 +- .../migrations/20200107045207_tongji_sch.php | 2 +- .../migrations/202001132733_kaoshi_set.php | 2 +- .../migrations/20200309035912_tongji_log.php | 2 +- .../20200616052125_teacher_zhiwu.php | 2 +- .../migrations/20210107070200_kaoshi_up.php | 51 +++++++++++++++++++ 31 files changed, 84 insertions(+), 29 deletions(-) create mode 100644 database/migrations/20210107070200_kaoshi_up.php diff --git a/app/kaoshi/controller/Index.php b/app/kaoshi/controller/Index.php index 8e557e86..51359bcd 100755 --- a/app/kaoshi/controller/Index.php +++ b/app/kaoshi/controller/Index.php @@ -41,6 +41,7 @@ class Index extends AdminBase ,'field' => 'id' ,'order' => 'desc' ,'searchval' => '' + ,'user_group' => 'admin' ], 'POST'); // 根据条件查询数据 $ks = new KS; @@ -101,6 +102,9 @@ class Index extends AdminBase if(!$result){ return json(['msg' => $msg, 'val' => 0]); } + $list['user_id'] = session('user_id'); + $list['user_group'] = 'admin'; + // $list['jibie_id'] = 1; // 保存数据 $ks = new KS(); diff --git a/database/migrations/20181010035225_system_base.php b/database/migrations/20181010035225_system_base.php index 0a9fd259..d287a657 100755 --- a/database/migrations/20181010035225_system_base.php +++ b/database/migrations/20181010035225_system_base.php @@ -26,7 +26,7 @@ class SystemBase extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义表的名称 $table = $this->table('system_base'); diff --git a/database/migrations/20181010075304_auth_group.php b/database/migrations/20181010075304_auth_group.php index 9fda2e6b..c5741659 100755 --- a/database/migrations/20181010075304_auth_group.php +++ b/database/migrations/20181010075304_auth_group.php @@ -26,7 +26,7 @@ class AuthGroup extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('auth_group'); diff --git a/database/migrations/20181010075517_auth_group_access.php b/database/migrations/20181010075517_auth_group_access.php index 5b184d75..666a62cd 100755 --- a/database/migrations/20181010075517_auth_group_access.php +++ b/database/migrations/20181010075517_auth_group_access.php @@ -26,7 +26,7 @@ class AuthGroupAccess extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('auth_group_access'); diff --git a/database/migrations/20181010075553_auth_rule.php b/database/migrations/20181010075553_auth_rule.php index f33a5354..fb360f46 100755 --- a/database/migrations/20181010075553_auth_rule.php +++ b/database/migrations/20181010075553_auth_rule.php @@ -26,7 +26,7 @@ class AuthRule extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('auth_rule'); diff --git a/database/migrations/20181012140355_member.php b/database/migrations/20181012140355_member.php index 56eed86a..fe722358 100755 --- a/database/migrations/20181012140355_member.php +++ b/database/migrations/20181012140355_member.php @@ -26,7 +26,7 @@ class Member extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('admin'); diff --git a/database/migrations/20181025041505_category.php b/database/migrations/20181025041505_category.php index 529351ab..5604c8f9 100755 --- a/database/migrations/20181025041505_category.php +++ b/database/migrations/20181025041505_category.php @@ -26,7 +26,7 @@ class Category extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('category'); diff --git a/database/migrations/20181026002455_school.php b/database/migrations/20181026002455_school.php index 290490a1..b83bb955 100755 --- a/database/migrations/20181026002455_school.php +++ b/database/migrations/20181026002455_school.php @@ -26,7 +26,7 @@ class School extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('school'); diff --git a/database/migrations/20181028023517_teacher.php b/database/migrations/20181028023517_teacher.php index d296b568..eccfb7e6 100755 --- a/database/migrations/20181028023517_teacher.php +++ b/database/migrations/20181028023517_teacher.php @@ -26,7 +26,7 @@ class Teacher extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('teacher'); diff --git a/database/migrations/20181028024920_xueqi.php b/database/migrations/20181028024920_xueqi.php index 89a356c6..b65573c5 100755 --- a/database/migrations/20181028024920_xueqi.php +++ b/database/migrations/20181028024920_xueqi.php @@ -26,7 +26,7 @@ class Xueqi extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('xueqi'); diff --git a/database/migrations/20181028025648_kaoshi.php b/database/migrations/20181028025648_kaoshi.php index 0ea71635..cafff944 100755 --- a/database/migrations/20181028025648_kaoshi.php +++ b/database/migrations/20181028025648_kaoshi.php @@ -26,7 +26,7 @@ class Kaoshi extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('kaoshi'); diff --git a/database/migrations/20181030024954_subject.php b/database/migrations/20181030024954_subject.php index 9dba14f6..41ba9a72 100755 --- a/database/migrations/20181030024954_subject.php +++ b/database/migrations/20181030024954_subject.php @@ -26,7 +26,7 @@ class Subject extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('subject'); diff --git a/database/migrations/20181101040801_fields.php b/database/migrations/20181101040801_fields.php index ecc891c7..9d66b6f8 100755 --- a/database/migrations/20181101040801_fields.php +++ b/database/migrations/20181101040801_fields.php @@ -26,7 +26,7 @@ class Fields extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('fields'); diff --git a/database/migrations/20181102003411_student.php b/database/migrations/20181102003411_student.php index 0e16075f..e10d58b3 100755 --- a/database/migrations/20181102003411_student.php +++ b/database/migrations/20181102003411_student.php @@ -26,7 +26,7 @@ class Student extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('student'); diff --git a/database/migrations/20181102004156_banji.php b/database/migrations/20181102004156_banji.php index cd7f0259..20627896 100755 --- a/database/migrations/20181102004156_banji.php +++ b/database/migrations/20181102004156_banji.php @@ -26,7 +26,7 @@ class Banji extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('banji'); diff --git a/database/migrations/20181114055804_kaohao.php b/database/migrations/20181114055804_kaohao.php index 0c02bd84..4b9e23ba 100755 --- a/database/migrations/20181114055804_kaohao.php +++ b/database/migrations/20181114055804_kaohao.php @@ -26,7 +26,7 @@ class Kaohao extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('kaohao'); diff --git a/database/migrations/20181218041034_dw_rongyu.php b/database/migrations/20181218041034_dw_rongyu.php index 4099df2a..1cd8fc4b 100755 --- a/database/migrations/20181218041034_dw_rongyu.php +++ b/database/migrations/20181218041034_dw_rongyu.php @@ -26,7 +26,7 @@ class DwRongyu extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('dw_rongyu'); diff --git a/database/migrations/20181221041509_js_rongyu.php b/database/migrations/20181221041509_js_rongyu.php index 7fb3deee..52037a46 100755 --- a/database/migrations/20181221041509_js_rongyu.php +++ b/database/migrations/20181221041509_js_rongyu.php @@ -26,7 +26,7 @@ class JsRongyu extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('js_rongyu'); diff --git a/database/migrations/20181221041523_js_rongyu_info.php b/database/migrations/20181221041523_js_rongyu_info.php index ec72f4ff..f63bfca3 100755 --- a/database/migrations/20181221041523_js_rongyu_info.php +++ b/database/migrations/20181221041523_js_rongyu_info.php @@ -26,7 +26,7 @@ class JsRongyuInfo extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('js_rongyu_info'); diff --git a/database/migrations/20181227061353_dw_rongyu_canyu.php b/database/migrations/20181227061353_dw_rongyu_canyu.php index fbca7ad0..2ac74f26 100755 --- a/database/migrations/20181227061353_dw_rongyu_canyu.php +++ b/database/migrations/20181227061353_dw_rongyu_canyu.php @@ -26,7 +26,7 @@ class DwRongyuCanyu extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('dw_rongyu_canyu'); diff --git a/database/migrations/20190214052203_js_rongyu_canyu.php b/database/migrations/20190214052203_js_rongyu_canyu.php index 9c5dc02d..863dc5cf 100755 --- a/database/migrations/20190214052203_js_rongyu_canyu.php +++ b/database/migrations/20190214052203_js_rongyu_canyu.php @@ -26,7 +26,7 @@ class JsRongyuCanyu extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('js_rongyu_canyu'); diff --git a/database/migrations/20190218055858_keti.php b/database/migrations/20190218055858_keti.php index d05fc17e..51c2d328 100755 --- a/database/migrations/20190218055858_keti.php +++ b/database/migrations/20190218055858_keti.php @@ -26,7 +26,7 @@ class Keti extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('keti'); diff --git a/database/migrations/20190222040223_keti_info.php b/database/migrations/20190222040223_keti_info.php index 44176b09..89c64162 100755 --- a/database/migrations/20190222040223_keti_info.php +++ b/database/migrations/20190222040223_keti_info.php @@ -26,7 +26,7 @@ class KetiInfo extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('keti_info'); diff --git a/database/migrations/20190222041040_keti_canyu.php b/database/migrations/20190222041040_keti_canyu.php index 96f30e6c..c9300c88 100755 --- a/database/migrations/20190222041040_keti_canyu.php +++ b/database/migrations/20190222041040_keti_canyu.php @@ -26,7 +26,7 @@ class KetiCanyu extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('keti_canyu'); diff --git a/database/migrations/20190430034853_chengji.php b/database/migrations/20190430034853_chengji.php index f0e80cd6..beda0c20 100755 --- a/database/migrations/20190430034853_chengji.php +++ b/database/migrations/20190430034853_chengji.php @@ -26,7 +26,7 @@ class Chengji extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('chengji'); diff --git a/database/migrations/20200106013922_tongji_bj.php b/database/migrations/20200106013922_tongji_bj.php index 3e67f87e..9ac141a7 100755 --- a/database/migrations/20200106013922_tongji_bj.php +++ b/database/migrations/20200106013922_tongji_bj.php @@ -26,7 +26,7 @@ class TongjiBj extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('tongji_bj'); diff --git a/database/migrations/20200107045207_tongji_sch.php b/database/migrations/20200107045207_tongji_sch.php index 567e48a4..619b5cb0 100755 --- a/database/migrations/20200107045207_tongji_sch.php +++ b/database/migrations/20200107045207_tongji_sch.php @@ -26,7 +26,7 @@ class TongjiSch extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('tongji_sch'); diff --git a/database/migrations/202001132733_kaoshi_set.php b/database/migrations/202001132733_kaoshi_set.php index 7b656d3b..cc030acc 100755 --- a/database/migrations/202001132733_kaoshi_set.php +++ b/database/migrations/202001132733_kaoshi_set.php @@ -26,7 +26,7 @@ class KaoshiSet extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('kaoshi_set'); diff --git a/database/migrations/20200309035912_tongji_log.php b/database/migrations/20200309035912_tongji_log.php index 5f6852a9..60ce4021 100755 --- a/database/migrations/20200309035912_tongji_log.php +++ b/database/migrations/20200309035912_tongji_log.php @@ -26,7 +26,7 @@ class TongjiLog extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('tongji_log'); diff --git a/database/migrations/20200616052125_teacher_zhiwu.php b/database/migrations/20200616052125_teacher_zhiwu.php index eccd4936..a2e42b0c 100755 --- a/database/migrations/20200616052125_teacher_zhiwu.php +++ b/database/migrations/20200616052125_teacher_zhiwu.php @@ -26,7 +26,7 @@ class TeacherZhiwu extends Migrator * Remember to call "create()" or "update()" and NOT "save()" when working * with the Table class. */ - public function up() + public function change() { // 定义数据表名称 $table = $this->table('teacher_zhiwu'); diff --git a/database/migrations/20210107070200_kaoshi_up.php b/database/migrations/20210107070200_kaoshi_up.php new file mode 100644 index 00000000..dcb5724c --- /dev/null +++ b/database/migrations/20210107070200_kaoshi_up.php @@ -0,0 +1,51 @@ +table('kaoshi'); + + $table + ->addColumn('user_id','integer',array('after' => 'category_id'),['limit'=>11,'default'=>0,'null'=>false,'comment'=>'用户ID']) + ->addColumn('user_group','string',array('after' => 'user_id'),['limit'=>25,'default'=>'a','null'=>false,'comment'=>'用户组']) + ->addColumn('jibie_id','integer',array('after' => 'user_group'),['limit'=>11,'default'=>1,'null'=>false,'comment'=>'级别ID']) + ->update(); + } + + + public function down() + { + // 定义数据表名称 + $table = $this->table('kaoshi'); + + $table + ->removeColumn('user_id', 'user_group', 'jibie_id') + ->update(); + } +}