From f37b0c2616f61f552f8dc6560441cfded79144ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Wed, 22 Apr 2020 13:09:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Update/controller/Admin.php | 68 ++++++++++--------- app/Update/route/update.php | 6 +- app/Update/view/admin/index.html | 13 ++++ app/chengji/controller/Bjtongji.php | 4 +- app/chengji/controller/Njtongji.php | 4 +- app/chengji/controller/Schtongji.php | 4 +- app/event/MyEvent.php | 6 +- app/kaohao/model/Search.php | 4 +- .../migrations/20181010075553_auth_rule.php | 2 +- .../migrations/20181025041505_category.php | 2 +- database/migrations/20181028024920_xueqi.php | 2 +- .../migrations/20181030024954_subject.php | 2 +- database/migrations/20181101040801_fields.php | 2 +- .../migrations/20181218041034_dw_rongyu.php | 2 +- .../migrations/20181221041509_js_rongyu.php | 2 +- .../migrations/20190222040223_keti_info.php | 2 +- .../migrations/20190430034853_chengji.php | 4 +- .../migrations/20200106012240_tongji_nj.php | 2 +- .../migrations/20200106013922_tongji_bj.php | 2 +- .../migrations/20200107045207_tongji_sch.php | 2 +- .../migrations/20200309035912_tongji_log.php | 2 +- database/seeds/Category.php | 5 +- 22 files changed, 80 insertions(+), 62 deletions(-) diff --git a/app/Update/controller/Admin.php b/app/Update/controller/Admin.php index 84e841cd..5c715691 100644 --- a/app/Update/controller/Admin.php +++ b/app/Update/controller/Admin.php @@ -30,12 +30,12 @@ class Admin $old = new \app\admin\model\Admin; // 整理数据 - // $oldId = $old->select()->toArray(); - $oldId = $old->column('id'); + $oldId = $old::withTrashed()->select(); $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { - $oldList = $old->find($value)->getData(); + $oldList = $value->getData(); + $oldList['school_id'] = $oldList['school']; $newList = $new->create($oldList); if ($newList) { $i ++; @@ -53,12 +53,11 @@ class Admin $old = new \app\teach\model\Banji; // 整理数据 - // $oldId = $old->select()->toArray(); - $oldId = $old->column('id'); + $oldId = $old::withTrashed()->select(); $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { - $oldList = $old->find($value)->getData(); + $oldList = $value->getData(); $oldList['school_id'] = $oldList['school']; $oldList['xueduan_id'] = 10302; $newList = $new->create($oldList); @@ -79,7 +78,7 @@ class Admin $old = new \app\chengji\model\Chengji; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -89,6 +88,7 @@ class Admin $oldList = $value->getData(); unset($oldList['id']); $oldList['defenlv'] = $oldList['defen']; + $oldList['subject_id'] = getNewSubject($oldList['subject_id']); $newList[] = $oldList; } @@ -107,7 +107,7 @@ class Admin $old = new \app\rongyu\model\DwRongyu; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -137,7 +137,7 @@ class Admin $old = new \app\rongyu\model\DwRongyuCanyu; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -169,7 +169,7 @@ class Admin $old = new \app\system\model\Fields; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -197,7 +197,7 @@ class Admin $old = new \app\rongyu\model\JsRongyu; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -225,7 +225,7 @@ class Admin $old = new \app\rongyu\model\JsRongyuCanyu; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -258,7 +258,7 @@ class Admin $old = new \app\rongyu\model\JsRongyuInfo; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -282,18 +282,18 @@ class Admin // Kaohao - public function kaohao() + public function kaohao($page) { set_time_limit(0); $new = new \app\update\model\Kaohao; $old = new \app\kaohao\model\Kaohao; // 整理数据 - $oldId = $old - // ->limit(10) + dump('第'.$page.'页'); + $oldId = $old::withTrashed() + ->page($page, 500) ->select(); - - $new->where('id', '>', 0)->delete(); + // $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { @@ -320,7 +320,7 @@ class Admin $old = new \app\Kaoshi\model\Kaoshi; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -350,7 +350,7 @@ class Admin $old = new \app\Keti\model\Keti; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -378,7 +378,7 @@ class Admin $old = new \app\Keti\model\KetiCanyu; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -405,14 +405,14 @@ class Admin // KetiInfo - public function KetiINfo() + public function KetiInfo() { set_time_limit(0); $new = new \app\update\model\KetiInfo; $old = new \app\Keti\model\KetiInfo; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -443,7 +443,7 @@ class Admin $old = new \app\system\model\School; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); @@ -465,7 +465,7 @@ class Admin } // Student - public function Student() + public function Student($page) { set_time_limit(0); $new = new \app\update\model\Student; @@ -473,10 +473,11 @@ class Admin $pinyin = new \Overtrue\Pinyin\Pinyin; // 整理数据 - $oldId = $old + dump('第'.$page.'页'); + $oldId = $old->withTrashed() + ->page($page, 500) ->select(); - - $new->where('id', '>', 0)->delete(); + // $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { @@ -498,7 +499,7 @@ class Admin // Teacher - public function Teacher() + public function Teacher($page) { set_time_limit(0); $new = new \app\update\model\Teacher; @@ -506,10 +507,11 @@ class Admin $pinyin = new \Overtrue\Pinyin\Pinyin; // 整理数据 - $oldId = $old + dump('第'.$page.'页'); + $oldId = $old::withTrashed() + ->page($page, 500) ->select(); - - $new->where('id', '>', 0)->delete(); + // $new->where('id', '>', 0)->delete(); $i = 0; foreach ($oldId as $key => $value) { @@ -541,7 +543,7 @@ class Admin $old = new \app\teach\model\Xueqi; // 整理数据 - $oldId = $old + $oldId = $old::withTrashed() ->select(); $new->where('id', '>', 0)->delete(); diff --git a/app/Update/route/update.php b/app/Update/route/update.php index b27b69c2..576e5455 100644 --- a/app/Update/route/update.php +++ b/app/Update/route/update.php @@ -23,14 +23,14 @@ Route::group('admin', function () { Route::rule('jsrongyu','admin/jsrongyu','get'); # 信息列表 Route::rule('jsrongyucanyu','admin/jsrongyucanyu','get'); # 信息列表 Route::rule('jsrongyuinfo','admin/jsrongyuinfo','get'); # 信息列表 - Route::rule('kaohao','admin/kaohao','get'); # 信息列表 + Route::rule('kaohao/','admin/kaohao','get'); # 信息列表 Route::rule('kaoshi','admin/kaoshi','get'); # 信息列表 Route::rule('keti','admin/keti','get'); # 信息列表 Route::rule('keticanyu','admin/keticanyu','get'); # 信息列表 Route::rule('ketiinfo','admin/ketiinfo','get'); # 信息列表 Route::rule('school','admin/school','get'); # 信息列表 - Route::rule('student','admin/student','get'); # 信息列表 - Route::rule('teacher','admin/teacher','get'); # 信息列表 + Route::rule('student/','admin/student','get'); # 信息列表 + Route::rule('teacher/','admin/teacher','get'); # 信息列表 Route::rule('xueqi','admin/xueqi','get'); # 信息列表 }); diff --git a/app/Update/view/admin/index.html b/app/Update/view/admin/index.html index 26e52225..8a074a56 100644 --- a/app/Update/view/admin/index.html +++ b/app/Update/view/admin/index.html @@ -22,6 +22,19 @@ {/block} {block name="table"} +
+
+
+
+ Kaohao、Stuent、Teacher三个表的数据需要分页迁移,否则会卡死。 +
+ 127.0.0.1/update/admin/kaosho/1 1是页码
+ 127.0.0.1/update/admin/student/1 1是页码
+ 127.0.0.1/update/admin/teacher/1 1是页码
+
+
+
+
diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 9ebfa4c3..868b0160 100644 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -275,7 +275,7 @@ class Bjtongji extends BaseController $data = ['msg' => '各班级成绩统计完成', 'val' => 1]; $src = [ 'kaoshi_id' => $kaoshi_id, - 'category_id' => 'bjtj', + 'category' => 'bjtj', ]; event('tjlog', $src); } else { @@ -302,7 +302,7 @@ class Bjtongji extends BaseController $data = ['msg' => '学生成绩在班级位置统计完成。', 'val' => 1]; $src = [ 'kaoshi_id' => $kaoshi_id - ,'category_id' => 'bjwz' + ,'category' => 'bjwz' ]; event('tjlog', $src); } else { diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index f1c78b7d..4f28932c 100644 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -264,7 +264,7 @@ class Njtongji extends BaseController ]; $src = [ 'kaoshi_id' => $kaoshi_id - ,'category_id' => 'njtj' + ,'category' => 'njtj' ]; event('tjlog', $src); } else { @@ -297,7 +297,7 @@ class Njtongji extends BaseController ]; $src = [ 'kaoshi_id' => $kaoshi_id - ,'category_id' => 'njwz' + ,'category' => 'njwz' ]; event('tjlog', $src); } else { diff --git a/app/chengji/controller/Schtongji.php b/app/chengji/controller/Schtongji.php index 1dc9cc38..9abf2557 100644 --- a/app/chengji/controller/Schtongji.php +++ b/app/chengji/controller/Schtongji.php @@ -24,7 +24,7 @@ class Schtongji $data=['msg'=>'全区年级统计完成','val'=>1]; $src = [ 'kaoshi_id' => $kaoshi_id, - 'category_id' => 'schtj', + 'category' => 'schtj', ]; event('tjlog', $src); }else{ @@ -52,7 +52,7 @@ class Schtongji $data=['msg'=>'学生成绩在全区位置统计完成','val'=>1]; $src = [ 'kaoshi_id' => $kaoshi_id, - 'category_id' => 'schwz', + 'category' => 'schwz', ]; event('tjlog', $src); }else{ diff --git a/app/event/MyEvent.php b/app/event/MyEvent.php index b2180f92..f73f4889 100644 --- a/app/event/MyEvent.php +++ b/app/event/MyEvent.php @@ -20,13 +20,13 @@ class MyEvent // 添加考试统计日志 - public function addTongjiLog($kaoshi_id, $category_id) + public function addTongjiLog($kaoshi_id, $category) { // 添加统计日志 $tjLog = new TongjiLog; $log = $tjLog::withTrashed() ->where('kaoshi_id', $kaoshi_id) - ->where('category_id', $category_id) + ->where('category', $category) ->find(); if(true == $log) @@ -41,7 +41,7 @@ class MyEvent }else{ $data = $tjLog->save([ 'kaoshi_id' => $kaoshi_id, - 'category_id' => $category_id, + 'category' => $category, 'user_id' => session('userid'), ]); } diff --git a/app/kaohao/model/Search.php b/app/kaohao/model/Search.php index ca6dfbe7..e30d9fce 100644 --- a/app/kaohao/model/Search.php +++ b/app/kaohao/model/Search.php @@ -141,8 +141,8 @@ class Search extends BaseModel foreach ($value->banjiKaohao as $k => $val) { if($val->cjStudent == Null) { - $stuinof = $stu::withTrashed() - ->where('id', $val->student) + $stuinof = $stu::onlyTrashed() + ->where('id', $val->student_id) ->field('id, xingming') ->find(); $data[$key]->banjiKaohao[$key]->cjStudent = array('id' => $stuinof->id, 'xingming' => $stuinof->xingming); diff --git a/database/migrations/20181010075553_auth_rule.php b/database/migrations/20181010075553_auth_rule.php index 3d2438e2..f33a5354 100644 --- a/database/migrations/20181010075553_auth_rule.php +++ b/database/migrations/20181010075553_auth_rule.php @@ -41,7 +41,7 @@ class AuthRule extends Migrator ->addColumn('ismenu','boolean',['limit'=>1,'default'=>0,'null'=>false,'comment'=>'是否是菜单']) ->addColumn('font','string',['limit'=>40,'null'=>true,'comment'=>'菜单字体']) ->addColumn('url','string',['limit'=>40,'null'=>true,'comment'=>'菜单地址']) - ->addColumn('pid','integer',['limit'=>3,'default'=>0,'null'=>false,'comment'=>'父ID']) + ->addColumn('pid','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'父ID']) ->addColumn('type','boolean',['limit'=>1,'default'=>1,'null'=>false,'comment'=>'备用']) ->addColumn('create_time','integer',['limit'=>11,'default'=>1539158918,'null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>1539158918,'null'=>false,'comment'=>'更新时间']) diff --git a/database/migrations/20181025041505_category.php b/database/migrations/20181025041505_category.php index 25a2810a..529351ab 100644 --- a/database/migrations/20181025041505_category.php +++ b/database/migrations/20181025041505_category.php @@ -34,7 +34,7 @@ class Category extends Migrator // 添加当前表字段 $table ->addColumn('title','string',['limit'=>50,'default'=>'a','null'=>false,'comment'=>'类型标题']) - ->addColumn('p_id','integer',['limit'=>4,'default'=>'0','null'=>false,'comment'=>'父级ID']) + ->addColumn('p_id','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'父级ID']) ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常']) ->addColumn('paixu','integer',['limit'=>4,'default'=>'999','null'=>false,'comment'=>'排序']) ->addColumn('isupdate','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=不允许更新,1=允许更新']) diff --git a/database/migrations/20181028024920_xueqi.php b/database/migrations/20181028024920_xueqi.php index de694058..89a356c6 100644 --- a/database/migrations/20181028024920_xueqi.php +++ b/database/migrations/20181028024920_xueqi.php @@ -35,7 +35,7 @@ class Xueqi extends Migrator $table ->addColumn('title','string',['limit'=>25,'default'=>'a','null'=>false,'comment'=>'学期标题']) ->addColumn('xuenian','string',['limit'=>15,'default'=>'a','null'=>false,'comment'=>'学年标题']) - ->addColumn('category_id','string',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学期分类']) + ->addColumn('category_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学期分类']) ->addColumn('bfdate','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'开始日期']) ->addColumn('enddate','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'结束日期']) ->addColumn('status','boolean',['limit'=>1,'default'=>'1','null'=>false,'comment'=>'0=禁用,1=正常']) diff --git a/database/migrations/20181030024954_subject.php b/database/migrations/20181030024954_subject.php index 906a0743..9dba14f6 100644 --- a/database/migrations/20181030024954_subject.php +++ b/database/migrations/20181030024954_subject.php @@ -36,7 +36,7 @@ class Subject extends Migrator ->addColumn('title','string',['limit'=>25,'default'=>'a','null'=>false,'comment'=>'学科名称']) ->addColumn('jiancheng','string',['limit'=>6,'default'=>'a','null'=>false,'comment'=>'简称']) ->addColumn('lieming','string',['limit'=>46,'default'=>'a','null'=>false,'comment'=>'列名']) - ->addColumn('category_id','string',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'大学科类别']) + ->addColumn('category_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'大学科类别']) ->addColumn('kaoshi','boolean',['limit'=>1,'default'=>false,'null'=>0,'comment'=>'是否参与考试']) ->addColumn('paixu','integer',['limit'=>4,'default'=>'999','null'=>false,'comment'=>'排序']) ->addColumn('status','boolean',['limit'=>1,'default'=>1,'null'=>false,'comment'=>'0=禁用,1=正常']) diff --git a/database/migrations/20181101040801_fields.php b/database/migrations/20181101040801_fields.php index 6679e689..28e7957d 100644 --- a/database/migrations/20181101040801_fields.php +++ b/database/migrations/20181101040801_fields.php @@ -33,7 +33,7 @@ class Fields extends Migrator // 添加当前表字段 $table - ->addColumn('category_id','string',['limit'=>100,'default'=>0,'null'=>false,'comment'=>'文件分类']) + ->addColumn('category_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'文件分类']) ->addColumn('oldname','string',['limit'=>100,'default'=>'a','null'=>false,'comment'=>'原文件名']) ->addColumn('bianjitime','integer',['limit'=>11,'null'=>true,'comment'=>'最后编辑时间']) ->addColumn('newname','string',['limit'=>100,'default'=>'a','null'=>false,'comment'=>'新文件名']) diff --git a/database/migrations/20181218041034_dw_rongyu.php b/database/migrations/20181218041034_dw_rongyu.php index 76323eaf..061e8876 100644 --- a/database/migrations/20181218041034_dw_rongyu.php +++ b/database/migrations/20181218041034_dw_rongyu.php @@ -40,7 +40,7 @@ class DwRongyu extends Migrator ->addColumn('fzshijian','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'发证时间']) ->addColumn('url','string',['limit'=>100,'default'=>'a','null'=>false,'comment'=>'荣誉图片']) ->addColumn('jiangxiang_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'奖项']) - ->addColumn('category_id','integer',['limit'=>15,'default'=>0,'null'=>false,'comment'=>'荣誉类型']) + ->addColumn('category_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'荣誉类型']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) diff --git a/database/migrations/20181221041509_js_rongyu.php b/database/migrations/20181221041509_js_rongyu.php index c19b625e..4a54c52e 100644 --- a/database/migrations/20181221041509_js_rongyu.php +++ b/database/migrations/20181221041509_js_rongyu.php @@ -36,7 +36,7 @@ class JsRongyu extends Migrator ->addColumn('title','string',['limit'=>50,'default'=>'a','null'=>false,'comment'=>'荣誉册名称']) ->addColumn('fzschool_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'发证单位']) ->addColumn('fzshijian','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'发证时间']) - ->addColumn('category_id','integer',['limit'=>15,'default'=>0,'null'=>false,'comment'=>'类型']) + ->addColumn('category_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'类型']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) ->addColumn('delete_time','integer',['limit'=>11,'null'=>true,'comment'=>'删除时间']) diff --git a/database/migrations/20190222040223_keti_info.php b/database/migrations/20190222040223_keti_info.php index 1806bca7..ba75b312 100644 --- a/database/migrations/20190222040223_keti_info.php +++ b/database/migrations/20190222040223_keti_info.php @@ -42,7 +42,7 @@ class KetiInfo extends Migrator ->addColumn('category_id','integer',['limit'=>11,'null'=>true,'comment'=>'研究类型']) ->addColumn('jhjtshijian','integer',['limit'=>11,'null'=>true,'comment'=>'计划结题时间']) ->addColumn('jtshijian','integer',['limit'=>11,'null'=>true,'comment'=>'结题时间']) - ->addColumn('jddengji_id','integer',['limit'=>1,'null'=>false,'default'=>0,'comment'=>'鉴定等级']) + ->addColumn('jddengji_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'鉴定等级']) ->addColumn('jtpic','string',['limit'=>100,'null'=>true,'comment'=>'结题证书图片']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) diff --git a/database/migrations/20190430034853_chengji.php b/database/migrations/20190430034853_chengji.php index 4afea29d..6850438c 100644 --- a/database/migrations/20190430034853_chengji.php +++ b/database/migrations/20190430034853_chengji.php @@ -34,8 +34,8 @@ class Chengji extends Migrator // 添加当前表字段 $table ->addColumn('kaohao_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'考试']) - ->addColumn('subject_id','integer',['limit'=>4,'default'=>0,'null'=>false,'comment'=>'学科']) - ->addColumn('user_id','string',['limit'=>4,'default'=>0,'null'=>false,'comment'=>'学生']) + ->addColumn('subject_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'学科']) + ->addColumn('user_id','string',['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'=>'得分率']) diff --git a/database/migrations/20200106012240_tongji_nj.php b/database/migrations/20200106012240_tongji_nj.php index aef910d3..d1edf32d 100644 --- a/database/migrations/20200106012240_tongji_nj.php +++ b/database/migrations/20200106012240_tongji_nj.php @@ -36,7 +36,7 @@ class TongjiNj extends Migrator ->addColumn('school_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学校']) ->addColumn('kaoshi_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'考试']) ->addColumn('ruxuenian','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'入学年']) - ->addColumn('subject_id','string',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) + ->addColumn('subject_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) ->addColumn('stu_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'参加考试人数']) ->addColumn('chengji_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'有成绩数']) ->addColumn('sum','decimal',['precision'=>10,'scale'=>1,'null'=>true,'comment'=>'总分']) diff --git a/database/migrations/20200106013922_tongji_bj.php b/database/migrations/20200106013922_tongji_bj.php index ace59736..a43f8c9f 100644 --- a/database/migrations/20200106013922_tongji_bj.php +++ b/database/migrations/20200106013922_tongji_bj.php @@ -35,7 +35,7 @@ class TongjiBj extends Migrator $table ->addColumn('kaoshi_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'考试']) ->addColumn('banji_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'班级']) - ->addColumn('subject_id','string',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) + ->addColumn('subject_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) ->addColumn('stu_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'参加考试人数']) ->addColumn('chengji_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'有成绩数']) ->addColumn('sum','decimal',['precision'=>10,'scale'=>1,'null'=>true,'comment'=>'总分']) diff --git a/database/migrations/20200107045207_tongji_sch.php b/database/migrations/20200107045207_tongji_sch.php index ec45727c..67d7c54d 100644 --- a/database/migrations/20200107045207_tongji_sch.php +++ b/database/migrations/20200107045207_tongji_sch.php @@ -35,7 +35,7 @@ class TongjiSch extends Migrator $table ->addColumn('kaoshi_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'考试']) ->addColumn('ruxuenian','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'入学年']) - ->addColumn('subject_id','string',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) + ->addColumn('subject_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'学科']) ->addColumn('stu_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'参加考试人数']) ->addColumn('chengji_cnt','integer',['limit'=>11,'null'=>true,'comment'=>'有成绩数']) ->addColumn('sum','decimal',['precision'=>10,'scale'=>1,'null'=>true,'comment'=>'总分']) diff --git a/database/migrations/20200309035912_tongji_log.php b/database/migrations/20200309035912_tongji_log.php index 07a1a204..82f248cb 100644 --- a/database/migrations/20200309035912_tongji_log.php +++ b/database/migrations/20200309035912_tongji_log.php @@ -34,7 +34,7 @@ class TongjiLog extends Migrator // 添加当前表字段 $table ->addColumn('kaoshi_id','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'考试ID']) - ->addColumn('category_id','string',['limit'=>25,'default'=>'a','null'=>false,'comment'=>'统计项目']) + ->addColumn('category','string',['limit'=>25,'default'=>'a','null'=>false,'comment'=>'统计项目']) ->addColumn('user_id','integer',['limit'=>11,'default'=>'0','null'=>false,'comment'=>'统计人ID']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) ->addColumn('update_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'更新时间']) diff --git a/database/seeds/Category.php b/database/seeds/Category.php index 36a479d5..06b4144c 100644 --- a/database/seeds/Category.php +++ b/database/seeds/Category.php @@ -171,6 +171,7 @@ class Category extends Seeder // 单位荣誉分类 ['id' => 11201,'title' => '科研','p_id' => 112,'paixu' => 1,'isupdate' => 0], ['id' => 11202,'title' => '特色','p_id' => 112,'paixu' => 2,'isupdate' => 0], + ['id' => 11203,'title' => '教研','p_id' => 112,'paixu' => 3,'isupdate' => 0], ['id' => 113 ,'title' => '荣誉奖项' ,'p_id' => 0 @@ -197,7 +198,9 @@ class Category extends Seeder ['id' => 11402,'title' => '技能大赛','p_id' => 114,'paixu' => 2,'isupdate' => 0], ['id' => 11403,'title' => '论文','p_id' => 114,'paixu' => 3,'isupdate' => 0], ['id' => 11404,'title' => '教科研','p_id' => 114,'paixu' => 4,'isupdate' => 0], - ['id' => 114055,'title' => '荣誉称号','p_id' => 114,'paixu' => 4,'isupdate' => 0], + ['id' => 11405,'title' => '荣誉称号','p_id' => 114,'paixu' => 5,'isupdate' => 0], + ['id' => 11406,'title' => '培训','p_id' => 114,'paixu' => 6,'isupdate' => 0], + ['id' => 11407,'title' => '展示课','p_id' => 114,'paixu' => 7,'isupdate' => 0], ['id' => 115 ,'title' => '课题立项类型' ,'p_id' => 0