From 61b0c3742aae2e18aafb55d7f9928b3e496f8b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Thu, 26 Sep 2019 13:45:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8mysql5.7=E4=BB=A5?= =?UTF-8?q?=E4=B8=8A=E5=87=BA=E7=8E=B0=E7=9A=84=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chengji/controller/Tongji.php | 1 + application/chengji/model/Tongji.php | 1 + application/common.php | 3 +- application/kaoshi/model/Kaohao.php | 6 +- application/renshi/common.php | 98 +++++++++---------- application/teach/controller/Banji.php | 9 +- database/migrations/20181101040801_fields.php | 2 +- public/.htaccess | 2 +- 8 files changed, 64 insertions(+), 58 deletions(-) diff --git a/application/chengji/controller/Tongji.php b/application/chengji/controller/Tongji.php index dab6587d..8d6e9a93 100644 --- a/application/chengji/controller/Tongji.php +++ b/application/chengji/controller/Tongji.php @@ -64,6 +64,7 @@ class Tongji extends Base // 统计成绩 $tj = new TJ; + $data = $tj->tjBanji($src['kaoshi'],$src['nianji'],$src['school'],$src['paixu']); diff --git a/application/chengji/model/Tongji.php b/application/chengji/model/Tongji.php index 0448e944..cfe84878 100644 --- a/application/chengji/model/Tongji.php +++ b/application/chengji/model/Tongji.php @@ -305,6 +305,7 @@ class Tongji extends Model 'school'=>$value->cj_school->jiancheng, 'chengji'=>$temp ]; + } diff --git a/application/common.php b/application/common.php index 60f19c6b..acddd596 100644 --- a/application/common.php +++ b/application/common.php @@ -230,6 +230,7 @@ function upload($list,$file,$isSave=false) // 实例化文件数据模型 $field = new \app\system\model\Fields; + // 移动到框架应用根目录/uploads/ 目录下 $info = $file->move($myrul.$list['serurl']); @@ -242,7 +243,6 @@ function upload($list,$file,$isSave=false) } - // 成功上传后 获取上传信息 $list['category'] = $info->getExtension(); $list['url'] = $list['serurl'].$info->getSaveName(); @@ -251,6 +251,7 @@ function upload($list,$file,$isSave=false) $list['userid'] = session('userid'); $list['oldname'] = $info->getInfo('name'); $list['fieldsize'] = $info->getInfo('size'); + // $list['bianjitime'] = Null; // 如果需要保存文件 diff --git a/application/kaoshi/model/Kaohao.php b/application/kaoshi/model/Kaohao.php index 5f80f64e..143a6025 100644 --- a/application/kaoshi/model/Kaohao.php +++ b/application/kaoshi/model/Kaohao.php @@ -291,7 +291,7 @@ class Kaohao extends Base } ]) ->group('school') - ->field('id,school') + ->field('school') ->select(); return $data; @@ -326,8 +326,8 @@ class Kaohao extends Base $query->field('id,jiancheng'); } ]) - ->group('banji') - ->field('id,banji,school') + ->group('banji,school') + ->field('banji,school') ->select(); return $data; } diff --git a/application/renshi/common.php b/application/renshi/common.php index 82cef480..b9d2bde1 100644 --- a/application/renshi/common.php +++ b/application/renshi/common.php @@ -1,66 +1,66 @@ where('title',$str)->value('id'); + // 查询学科id + $subjectId = $subject->where('title',$str)->value('id'); -// return $subjectId; -// } + return $subjectId; +} -// // 查找职务 -// function srcZw($str) -// { -// // 实例化类型数据模型 -// $category = new \app\system\model\Category; +// 查找职务 +function srcZw($str) +{ + // 实例化类型数据模型 + $category = new \app\system\model\Category; -// // 查询学科id -// $categoryId = $category->where('pid',107)->where('title',$str)->value('id'); + // 查询学科id + $categoryId = $category->where('pid',107)->where('title',$str)->value('id'); -// return $categoryId; -// } + return $categoryId; +} -// // 查找学历 -// function srcXl($str) -// { -// // 实例化类型数据模型 -// $category = new \app\system\model\Category; +// 查找学历 +function srcXl($str) +{ + // 实例化类型数据模型 + $category = new \app\system\model\Category; -// // 查询学科id -// $categoryId = $category->where('pid',105)->where('title',$str)->value('id'); + // 查询学科id + $categoryId = $category->where('pid',105)->where('title',$str)->value('id'); -// return $categoryId; -// } + return $categoryId; +} -// // 查找职称 -// function srcZc($str) -// { -// // 实例化类型数据模型 -// $category = new \app\system\model\Category; +// 查找职称 +function srcZc($str) +{ + // 实例化类型数据模型 + $category = new \app\system\model\Category; -// // 查询学科id -// $categoryId = $category->where('pid',106)->where('title',$str)->value('id'); + // 查询学科id + $categoryId = $category->where('pid',106)->where('title',$str)->value('id'); -// return $categoryId; -// } + return $categoryId; +} diff --git a/application/teach/controller/Banji.php b/application/teach/controller/Banji.php index 92f11c93..e6f0590f 100644 --- a/application/teach/controller/Banji.php +++ b/application/teach/controller/Banji.php @@ -315,14 +315,17 @@ class Banji extends Base $bjnamelist = banjinamelist(); $njlist = array_keys($njanmelist); - + if(is_array($ruxuenian)==false) + { + $ruxuenian = array($ruxuenian); + } // 查询年级数据 $list = BJ:: where('school',$school) ->where('ruxuenian','in',$ruxuenian) - ->group('ruxuenian') - ->field('id,ruxuenian') ->where('status',1) + ->group('ruxuenian') + ->field('ruxuenian') ->with([ 'njBanji'=>function($query)use($school){ $query->where('status',1) diff --git a/database/migrations/20181101040801_fields.php b/database/migrations/20181101040801_fields.php index a804a3af..863a65f1 100644 --- a/database/migrations/20181101040801_fields.php +++ b/database/migrations/20181101040801_fields.php @@ -35,7 +35,7 @@ class Fields extends Migrator $table ->addColumn('text','string',['limit'=>100,'null'=>false,'comment'=>'文件内容']) ->addColumn('oldname','string',['limit'=>100,'null'=>false,'comment'=>'原文件名']) - ->addColumn('bianjitime','integer',['limit'=>11,'null'=>false,'comment'=>'最后编辑时间']) + ->addColumn('bianjitime','integer',['limit'=>11,'null'=>true,'comment'=>'最后编辑时间']) ->addColumn('newname','string',['limit'=>100,'null'=>false,'comment'=>'新文件名']) ->addColumn('category','string',['limit'=>100,'null'=>false,'comment'=>'文件类型']) ->addColumn('fieldsize','integer',['limit'=>11,'null'=>false,'comment'=>'文件大小']) diff --git a/public/.htaccess b/public/.htaccess index cbc78689..d9ee23c9 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -4,5 +4,5 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f - RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] + RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]