From c6c99252eedece5f2741811538fe68abfd1d058a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Wed, 22 Apr 2020 10:24:53 +0800 Subject: [PATCH 1/2] 0 --- app/Update/common.php | 43 +++ app/Update/controller/Admin.php | 565 +++++++++++++++++++++++++++++ app/Update/event.php | 5 + app/Update/middleware.php | 5 + app/Update/model/Admin.php | 15 + app/Update/model/Banji.php | 15 + app/Update/model/Category.php | 15 + app/Update/model/Chengji.php | 15 + app/Update/model/DwRongyu.php | 15 + app/Update/model/DwRongyuCanyu.php | 15 + app/Update/model/Fields.php | 15 + app/Update/model/JsRongyu.php | 15 + app/Update/model/JsRongyuCanyu.php | 15 + app/Update/model/JsRongyuInfo.php | 15 + app/Update/model/Kaohao.php | 15 + app/Update/model/Kaoshi.php | 16 + app/Update/model/Keti.php | 15 + app/Update/model/KetiCanyu.php | 15 + app/Update/model/KetiInfo.php | 15 + app/Update/model/School.php | 15 + app/Update/model/Student.php | 15 + app/Update/model/Subject.php | 15 + app/Update/model/Teacher.php | 15 + app/Update/model/Xueqi.php | 15 + app/Update/route/update.php | 36 ++ app/Update/view/admin/index.html | 210 +++++++++++ app/system/controller/Category.php | 1 + app/system/model/Fields.php | 2 + 28 files changed, 1168 insertions(+) create mode 100644 app/Update/common.php create mode 100644 app/Update/controller/Admin.php create mode 100644 app/Update/event.php create mode 100644 app/Update/middleware.php create mode 100644 app/Update/model/Admin.php create mode 100644 app/Update/model/Banji.php create mode 100644 app/Update/model/Category.php create mode 100644 app/Update/model/Chengji.php create mode 100644 app/Update/model/DwRongyu.php create mode 100644 app/Update/model/DwRongyuCanyu.php create mode 100644 app/Update/model/Fields.php create mode 100644 app/Update/model/JsRongyu.php create mode 100644 app/Update/model/JsRongyuCanyu.php create mode 100644 app/Update/model/JsRongyuInfo.php create mode 100644 app/Update/model/Kaohao.php create mode 100644 app/Update/model/Kaoshi.php create mode 100644 app/Update/model/Keti.php create mode 100644 app/Update/model/KetiCanyu.php create mode 100644 app/Update/model/KetiInfo.php create mode 100644 app/Update/model/School.php create mode 100644 app/Update/model/Student.php create mode 100644 app/Update/model/Subject.php create mode 100644 app/Update/model/Teacher.php create mode 100644 app/Update/model/Xueqi.php create mode 100644 app/Update/route/update.php create mode 100644 app/Update/view/admin/index.html diff --git a/app/Update/common.php b/app/Update/common.php new file mode 100644 index 00000000..95f24abd --- /dev/null +++ b/app/Update/common.php @@ -0,0 +1,43 @@ +where('id', $old_id)->value('title'); + $new_id = $new->where('title', $title)->value('id'); + + $new_id > 0 ? $new_id : $new_id = 0; + + return $new_id; +} + + +// Subject +function getNewSubject($old_id) +{ + $new = new \app\update\model\Subject; + $old = new \app\teach\model\Subject; + + $title = $old->where('id', $old_id)->value('title'); + $new_id = $new->where('title', $title)->value('id'); + + return $new_id; +} + + +// 鉴定等级 +function getNewDengji($dengji) +{ + $dj = [ + 0 => 11801 + ,1 => 11802 + ,2 => 11803 + ,3 => 11804 + ]; + return $dj[$dengji]; +} + diff --git a/app/Update/controller/Admin.php b/app/Update/controller/Admin.php new file mode 100644 index 00000000..84e841cd --- /dev/null +++ b/app/Update/controller/Admin.php @@ -0,0 +1,565 @@ +select()->toArray(); + $oldId = $old->column('id'); + $new->where('id', '>', 0)->delete(); + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $old->find($value)->getData(); + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + dump('Admin : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Admin : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // Banji + public function banji() + { + $new = new \app\update\model\Banji; + $old = new \app\teach\model\Banji; + + // 整理数据 + // $oldId = $old->select()->toArray(); + $oldId = $old->column('id'); + $new->where('id', '>', 0)->delete(); + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $old->find($value)->getData(); + $oldList['school_id'] = $oldList['school']; + $oldList['xueduan_id'] = 10302; + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + dump('Banji : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Banji : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // Chengji + public function chengji() + { + set_time_limit(0); + $new = new \app\update\model\Chengji; + $old = new \app\chengji\model\Chengji; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + unset($oldList['id']); + $oldList['defenlv'] = $oldList['defen']; + $newList[] = $oldList; + } + + $newList = $new->saveAll($newList); + $i = $newList->count(); + + dump('Chengji : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Chengji : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // DwRongyu + public function dwrongyu() + { + $new = new \app\update\model\DwRongyu; + $old = new \app\rongyu\model\DwRongyu; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['hjschool_id'] = $oldList['hjschool']; + $oldList['fzschool_id'] = $oldList['fzschool']; + $oldList['jiangxiang_id'] = getNewCategory($oldList['jiangxiang']); + $oldList['category_id'] = getNewCategory($oldList['category']); + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('DwRongyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'DwRongyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // DwRongyu + public function dwrongyucanyu() + { + $new = new \app\update\model\DwRongyuCanyu; + $old = new \app\rongyu\model\DwRongyuCanyu; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + unset($oldList['id']); + unset($oldList['update_time']); + unset($oldList['create_time']); + unset($oldList['delete_time']); + $oldList['rongyu_id'] = $oldList['rongyuid']; + $oldList['teacher_id'] = $oldList['teacherid']; + $newList[] = $oldList; + } + + $newList = $new->saveAll($newList); + $i = $newList->count(); + + dump('DwRongyuCanyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'DwRongyuCanyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // DwRongyu + public function fields() + { + $new = new \app\update\model\Fields; + $old = new \app\system\model\Fields; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + unset($oldList['id']); + $oldList['user_id'] = $oldList['userid']; + $newList[] = $oldList; + } + + $newList = $new->saveAll($newList); + $i = $newList->count(); + + dump('Fields : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Fields : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // JsRongyu + public function jsrongyu() + { + $new = new \app\update\model\JsRongyu; + $old = new \app\rongyu\model\JsRongyu; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['fzschool_id'] = $oldList['fzschool']; + $oldList['category_id'] = $oldList['category']; + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('JsRongyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'JsRongyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // JsRongyuCanyu + public function jsrongyucanyu() + { + $new = new \app\update\model\JsRongyuCanyu; + $old = new \app\rongyu\model\JsRongyuCanyu; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + unset($oldList['id']); + unset($oldList['update_time']); + unset($oldList['create_time']); + unset($oldList['delete_time']); + $oldList['category_id'] = $oldList['category']; + $oldList['rongyu_id'] = $oldList['rongyuid']; + $oldList['teacher_id'] = $oldList['teacherid']; + $newList[] = $oldList; + } + + $newList = $new->saveAll($newList); + $i = $newList->count(); + + dump('JsRongyuCanyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'JsRongyuCanyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // JsRongyuInfo + public function jsrongyuinfo() + { + $new = new \app\update\model\JsRongyuInfo; + $old = new \app\rongyu\model\JsRongyuInfo; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['rongyuce_id'] = $oldList['rongyuce']; + $oldList['hjschool_id'] = $oldList['hjschool']; + $oldList['subject_id'] = getNewSubject($oldList['subject']); + $oldList['jiangxiang_id'] = getNewCategory($oldList['jiangxiang']); + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('JsRongyuInfo : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'JsRongyuInfo : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // Kaohao + public function kaohao() + { + set_time_limit(0); + $new = new \app\update\model\Kaohao; + $old = new \app\kaohao\model\Kaohao; + + // 整理数据 + $oldId = $old + // ->limit(10) + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['kaoshi_id'] = $oldList['kaoshi']; + $oldList['school_id'] = $oldList['school']; + $oldList['banji_id'] = $oldList['banji']; + $oldList['student_id'] = $oldList['student']; + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('Kaohao : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Kaohao : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // Kaoshi + public function kaoshi() + { + $new = new \app\update\model\Kaoshi; + $old = new \app\Kaoshi\model\Kaoshi; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['zuzhi_id'] = $oldList['zuzhi']; + $oldList['xueqi_id'] = $oldList['xueqi']; + $oldList['category_id'] = $oldList['category']; + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('Kaoshi : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Kaoshi : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + + // Keti + public function Keti() + { + $new = new \app\update\model\Keti; + $old = new \app\Keti\model\Keti; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['lxdanwei_id'] = $oldList['lxdanweiid']; + $oldList['category_id'] = $oldList['category']; + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('Keti : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Keti : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // KetiCanyu + public function keticanyu() + { + $new = new \app\update\model\KetiCanyu; + $old = new \app\Keti\model\KetiCanyu; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + unset($oldList['id']); + unset($oldList['update_time']); + unset($oldList['create_time']); + unset($oldList['delete_time']); + $oldList['ketiinfo_id'] = $oldList['ketiinfoid']; + $oldList['teacher_id'] = $oldList['teacherid']; + $oldList['category_id'] = $oldList['category']; + $newList[] = $oldList; + } + + $newList = $new->saveAll($newList); + $i = $newList->count(); + + dump('KetiCanyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'KetiCanyu : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // KetiInfo + public function KetiINfo() + { + set_time_limit(0); + $new = new \app\update\model\KetiInfo; + $old = new \app\Keti\model\KetiInfo; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['ketice_id'] = $oldList['ketice']; + $oldList['subject_id'] = getNewSubject($oldList['subject']); + $oldList['fzdanwei_id'] = getNewCategory($oldList['fzdanweiid']); + $oldList['jddengji_id'] = getNewDengji($oldList['jddengji']); + $oldList['category_id'] = getNewCategory($oldList['category']); + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('KetiInfo : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'KetiInfo : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // School + public function school() + { + $new = new \app\update\model\School; + $old = new \app\system\model\School; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['xingzhi_id'] = getNewCategory($oldList['xingzhi']); + $oldList['jibie_id'] = getNewCategory($oldList['jibie']); + $oldList['xueduan_id'] = getNewCategory($oldList['xueduan']); + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('School : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'School : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + // Student + public function Student() + { + set_time_limit(0); + $new = new \app\update\model\Student; + $old = new \app\renshi\model\Student; + $pinyin = new \Overtrue\Pinyin\Pinyin; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['banji_id'] = $oldList['banji']; + $quanpin = $pinyin->sentence( $oldList['xingming']); + $oldList['shoupin'] = $pinyin->abbr( $oldList['xingming']); + $oldList['quanpin'] = trim(strtolower(str_replace(' ', '', $quanpin))); + + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('Student : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Student : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // Teacher + public function Teacher() + { + set_time_limit(0); + $new = new \app\update\model\Teacher; + $old = new \app\renshi\model\Teacher; + $pinyin = new \Overtrue\Pinyin\Pinyin; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['zhiwu_id'] = $oldList['zhiwu']; + $oldList['zhicheng_id'] = $oldList['zhicheng']; + $oldList['danwei_id'] = $oldList['danwei']; + $oldList['xueli_id'] = $oldList['xueli']; + $oldList['subject_id'] = $oldList['subject']; + $quanpin = $pinyin->sentence( $oldList['xingming']); + $oldList['shoupin'] = $pinyin->abbr( $oldList['xingming']); + $oldList['quanpin'] = trim(strtolower(str_replace(' ', '', $quanpin))); + + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('Teacher : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Teacher : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + + // Xueqi + public function xueqi() + { + $new = new \app\update\model\Xueqi; + $old = new \app\teach\model\Xueqi; + + // 整理数据 + $oldId = $old + ->select(); + + $new->where('id', '>', 0)->delete(); + + $i = 0; + foreach ($oldId as $key => $value) { + $oldList = $value->getData(); + $oldList['category_id'] = $oldList['category']; + + $newList = $new->create($oldList); + if ($newList) { + $i ++; + } + } + + dump('Xueqi : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'); + return 'Xueqi : 共' . count($oldId) . '条记录。创建' . $i . '条记录。'; + } + + +} diff --git a/app/Update/event.php b/app/Update/event.php new file mode 100644 index 00000000..4eff8908 --- /dev/null +++ b/app/Update/event.php @@ -0,0 +1,5 @@ + +// +---------------------------------------------------------------------- +use think\facade\Route; + + +// 学期管理 +Route::group('admin', function () { + Route::rule('index','admin/index','get'); # 信息列表 + Route::rule('admin','admin/admin','get'); # 信息列表 + Route::rule('banji','admin/banji','get'); # 信息列表 + Route::rule('chengji','admin/chengji','get'); # 信息列表 + Route::rule('dwrongyu','admin/dwrongyu','get'); # 信息列表 + Route::rule('dwrongyucanyu','admin/dwrongyucanyu','get'); # 信息列表 + Route::rule('fields','admin/fields','get'); # 信息列表 + 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('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('xueqi','admin/xueqi','get'); # 信息列表 + }); + diff --git a/app/Update/view/admin/index.html b/app/Update/view/admin/index.html new file mode 100644 index 00000000..26e52225 --- /dev/null +++ b/app/Update/view/admin/index.html @@ -0,0 +1,210 @@ + +{extend name=".././view/list.html" /} +{block name="jsset"} + +{/block} +{block name="nav"} + + 系统管理 + 文件管理 + 文件列表 + +{/block} +{block name="search"} +
+ +
+ +
+
+{/block} +{block name="table"} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
数据库
+ +
+ Admin +
+
+
+ +
+ Banji +
+
+
+ +
+ Chengji +
+
+
+ +
+ DwRongyu +
+
+
+ +
+ DwRongyuCanyu +
+
+
+ +
+ Fields +
+
+
+ +
+ JsRongyu +
+
+
+ +
+ jsrongyucanyu +
+
+
+ +
+ jsrongyuinfo +
+
+
+ +
+ kaohao +
+
+
+ +
+ kaoshi +
+
+
+ +
+ keti +
+
+
+ +
+ keticanyu +
+
+
+ +
+ ketiinfo +
+
+
+ +
+ school +
+
+
+ +
+ student +
+
+
+ +
+ teacher +
+
+
+ +
+ xueqi +
+
+
+ +{/block} +{block name="myjs"} + +{/block} diff --git a/app/system/controller/Category.php b/app/system/controller/Category.php index 022bafb0..b2aff0f8 100644 --- a/app/system/controller/Category.php +++ b/app/system/controller/Category.php @@ -50,6 +50,7 @@ class Category extends BaseController ,'paixu' ,'glPid' => ['title'] ,'isupdate' + ,'flCategory' => ['id','title'] ,'status' ,'update_time' ]); diff --git a/app/system/model/Fields.php b/app/system/model/Fields.php index 97c3f0a4..e34bd37a 100644 --- a/app/system/model/Fields.php +++ b/app/system/model/Fields.php @@ -60,12 +60,14 @@ class Fields extends BaseModel return $data; } + // 上传人数据关联 public function flUser() { return $this->belongsTo('\app\admin\model\Admin', 'user_id', 'id'); } + // 文件种类数模型关联 public function flCategory() { 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 2/2] =?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