From da16f34715ca48c619bf18d0aef24df04471d8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B7=B4=E6=8E=8C?= Date: Wed, 22 Apr 2020 13:33:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E4=B8=8E=E4=BA=BAid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Update/controller/Admin.php | 8 +++++--- app/keti/model/KetiInfo.php | 4 ++-- app/rongyu/model/JsRongyuInfo.php | 4 ++-- database/migrations/20190222041040_keti_canyu.php | 2 +- database/seeds/Category.php | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/Update/controller/Admin.php b/app/Update/controller/Admin.php index 5c715691..6b6abb4a 100644 --- a/app/Update/controller/Admin.php +++ b/app/Update/controller/Admin.php @@ -206,7 +206,7 @@ class Admin foreach ($oldId as $key => $value) { $oldList = $value->getData(); $oldList['fzschool_id'] = $oldList['fzschool']; - $oldList['category_id'] = $oldList['category']; + $oldList['category_id'] = getNewCategory($oldList['category']); $newList = $new->create($oldList); if ($newList) { $i ++; @@ -237,7 +237,8 @@ class Admin unset($oldList['update_time']); unset($oldList['create_time']); unset($oldList['delete_time']); - $oldList['category_id'] = $oldList['category']; + $oldList['category'] === 1 ? $oldList['category_id'] = 11901 + : $oldList['category_id'] = 11902; $oldList['rongyu_id'] = $oldList['rongyuid']; $oldList['teacher_id'] = $oldList['teacherid']; $newList[] = $oldList; @@ -392,7 +393,8 @@ class Admin unset($oldList['delete_time']); $oldList['ketiinfo_id'] = $oldList['ketiinfoid']; $oldList['teacher_id'] = $oldList['teacherid']; - $oldList['category_id'] = $oldList['category']; + $oldList['category'] === 1 ? $oldList['category_id'] = 11901 + : $oldList['category_id'] = 11902; $newList[] = $oldList; } diff --git a/app/keti/model/KetiInfo.php b/app/keti/model/KetiInfo.php index 8bc119b9..be69160f 100644 --- a/app/keti/model/KetiInfo.php +++ b/app/keti/model/KetiInfo.php @@ -202,7 +202,7 @@ class KetiInfo extends BaseModel public function ktZcr() { return $this->hasMany('\app\keti\model\KetiCanyu', 'ketiinfo_id', 'id') - ->where('category_id', 1); + ->where('category_id', 11901); } @@ -210,7 +210,7 @@ class KetiInfo extends BaseModel public function ktCy() { return $this->hasMany('\app\keti\model\KetiCanyu', 'ketiinfo_id', 'id') - ->where('category_id', 2); + ->where('category_id', 11902); } diff --git a/app/rongyu/model/JsRongyuInfo.php b/app/rongyu/model/JsRongyuInfo.php index 9cb698f2..b1c0fc5e 100644 --- a/app/rongyu/model/JsRongyuInfo.php +++ b/app/rongyu/model/JsRongyuInfo.php @@ -243,7 +243,7 @@ class JsRongyuInfo extends BaseModel // 获奖人信息关联 public function hjJsry() { - return $this->hasMany('\app\rongyu\model\JsRongyuCanyu', 'rongyu_id', 'id')->where('category_id',1); + return $this->hasMany('\app\rongyu\model\JsRongyuCanyu', 'rongyu_id', 'id')->where('category_id',11901); } @@ -257,7 +257,7 @@ class JsRongyuInfo extends BaseModel // 参与人关联 public function cyJsry() { - return $this->hasMany('\app\rongyu\model\JsRongyuCanyu', 'rongyu_id', 'id')->where('category_id',2); + return $this->hasMany('\app\rongyu\model\JsRongyuCanyu', 'rongyu_id', 'id')->where('category_id', 11902); } diff --git a/database/migrations/20190222041040_keti_canyu.php b/database/migrations/20190222041040_keti_canyu.php index f8afc729..96f30e6c 100644 --- a/database/migrations/20190222041040_keti_canyu.php +++ b/database/migrations/20190222041040_keti_canyu.php @@ -33,7 +33,7 @@ class KetiCanyu extends Migrator // 添加当前表字段 $table - ->addColumn('category_id','integer',['limit'=>1,'null'=>false,'default'=>0,'comment'=>'1=>课题主持人,2=>课题参与人']) + ->addColumn('category_id','integer',['limit'=>11,'null'=>false,'default'=>0,'comment'=>'课题主持人或课题参与人']) ->addColumn('ketiinfo_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'课题信息id']) ->addColumn('teacher_id','integer',['limit'=>11,'default'=>0,'null'=>false,'comment'=>'教师id']) ->addColumn('create_time','integer',['limit'=>11,'default'=>'1539158918','null'=>false,'comment'=>'创建时间']) diff --git a/database/seeds/Category.php b/database/seeds/Category.php index 06b4144c..d8e0fe25 100644 --- a/database/seeds/Category.php +++ b/database/seeds/Category.php @@ -236,7 +236,7 @@ class Category extends Seeder ['id' => 118 ,'title' => '课题状态' ,'p_id' => 0 - ,'paixu' => 17 + ,'paixu' => 18 ,'isupdate' => 0 ], // 结题等级类型 @@ -247,7 +247,7 @@ class Category extends Seeder ['id' => 119 ,'title' => '课题或荣誉角色' ,'p_id' => 0 - ,'paixu' => 17 + ,'paixu' => 19 ,'isupdate' => 0 ], // 课题或荣誉角色