From eb987f621ebd47652956264b49205db891777b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=E5=93=A5?= Date: Wed, 13 Oct 2021 15:02:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/AdminInfo.php | 2 +- app/chengji/controller/Bjtongji.php | 10 +-- app/chengji/controller/Index.php | 23 +++--- app/chengji/controller/Njtongji.php | 4 +- app/chengji/controller/Tongji.php | 2 +- app/chengji/model/Chengji.php | 29 ++++++- app/chengji/model/Tongji.php | 2 +- app/chengji/model/TongjiBj.php | 70 ++++++++++++----- app/chengji/model/TongjiNj.php | 46 +++++++++-- app/chengji/model/TongjiSch.php | 40 +++++++++- app/common.php | 4 +- app/kaohao/model/Kaohao.php | 6 +- app/kaohao/model/SearchCanYu.php | 78 +++++++++++++++---- app/kaohao/model/SearchMore.php | 6 +- app/kaohao/model/SearchOne.php | 6 +- app/kaoshi/controller/Index.php | 25 ++++-- app/kaoshi/controller/KsCanyu.php | 57 +++++++------- app/kaoshi/controller/LuruFengong.php | 13 ++-- app/kaoshi/model/Kaoshi.php | 12 ++- app/kaoshi/model/TongjiLog.php | 4 +- app/kaoshi/route/kaoshi.php | 2 +- app/kaoshi/view/luru_fengong/index.html | 2 +- app/luru/controller/Index.php | 6 +- app/rongyu/controller/Danwei.php | 2 +- app/student/controller/Index.php | 50 +++++------- app/student/model/Student.php | 41 ++++++++++ app/studentSearchChengji/controller/Index.php | 2 +- app/teach/controller/BanZhuRen.php | 4 +- app/teach/controller/Banji.php | 41 +++++----- app/teach/controller/BanjiChengji.php | 2 +- app/teach/model/BanZhuRen.php | 16 +++- app/teach/model/Banji.php | 6 +- app/tools/controller/Index.php | 4 +- app/tools/controller/OneStudentChengji.php | 4 +- app/tools/route/tools.php | 10 +-- 35 files changed, 431 insertions(+), 200 deletions(-) diff --git a/app/admin/controller/AdminInfo.php b/app/admin/controller/AdminInfo.php index d7c3bdd1..b049093c 100644 --- a/app/admin/controller/AdminInfo.php +++ b/app/admin/controller/AdminInfo.php @@ -185,7 +185,7 @@ class AdminInfo extends AdminBase $data = $bzr->srcTeacher($src); $src['all'] = true; $cnt = $bzr->srcTeacher($src)->count(); - $data = reSetObject($data, $cnt); + $data = reset_data($data, $cnt); return json($data); } diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 20691bdc..51eb7bdf 100755 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -27,7 +27,7 @@ class Bjtongji extends AdminBase $list['kaoshi_id'] = $kaoshi_id; $list['kaoshititle'] = $ksinfo->title; $list['dataurl'] = '/chengji/bjtj/data'; - $list['tjxm'] = srcTjxm(12201); + $list['tjxm'] = src_tjxm(12201); // 模板赋值 $this->view->assign('list', $list); @@ -67,7 +67,7 @@ class Bjtongji extends AdminBase // 统计成绩 $btj = new BTJ; $data = $btj->search($src); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } @@ -134,7 +134,7 @@ class Bjtongji extends AdminBase ,'ruxuenian' => '' ,'school_id' => array() ], 'POST'); - $src['school_id'] = strToarray($src['school_id']); + $src['school_id'] = str_to_array($src['school_id']); // 获取相关参数 ob_start(); @@ -177,7 +177,7 @@ class Bjtongji extends AdminBase ->setCategory("成绩管理"); //分类 // 设置要导出的项目、列名、起始行 - $sbjcol = srcTjxm(12202); + $sbjcol = src_tjxm(12202); $sbjcolcnt = count($sbjcol); $colname = excelColumnName(); $colcnt = $sbjcolcnt*count($xk)+3; @@ -678,7 +678,7 @@ class Bjtongji extends AdminBase $btj = new BTJ(); // 获取参考年级 $data = $btj->srcSubject($src); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index cea531a9..dd545c77 100755 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -16,20 +16,23 @@ class Index extends AdminBase // 获取参加考试的年级和学科 $ksset = new \app\kaoshi\model\KaoshiSet; - $list['set']['nianji'] = $ksset->srcGrade($kaoshi_id); - $src['kaoshi_id'] = $kaoshi_id; + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; + + $list['set']['nianji'] = $ksset->srcGrade($src); $list['set']['subject_id'] = $ksset->srcSubject($src); if (count($list['set']['nianji']) > 0) { $src['ruxuenian']=$list['set']['nianji'][0]; } else { $src['ruxuenian']=array(); } - $src['kaoshi_id'] = $kaoshi_id; $cy = new \app\kaohao\model\SearchCanYu; $list['set']['school_id'] = $cy->school($src); $list['kaoshi_id'] = $kaoshi_id; $list['dataurl'] = '/chengji/index/data'; - $list['tjxm'] = srcTjxm(12205); + $list['tjxm'] = src_tjxm(12205); // 模板赋值 $this->view->assign('list', $list); @@ -66,7 +69,9 @@ class Index extends AdminBase // 实例化并查询成绩 $cj = new Chengji; $data = $cj->search($src); - $data = reSetArray($data, $src); + $src['all'] = true; + $cnt = $data = $cj->search($src); + $data = reset_data($data, $cnt); return json($data); } @@ -265,8 +270,8 @@ class Index extends AdminBase $chengjiinfo = $more->srcChengjiList($src); $ksset = new \app\kaoshi\model\KaoshiSet; $subject_id = $ksset->srcSubject($src); - $tjxm_left = srcTjxm(12210); - $tjxm_right = srcTjxm(12206); + $tjxm_left = src_tjxm(12210); + $tjxm_right = src_tjxm(12206); // 获取考试标题 $ks = new \app\kaoshi\model\Kaoshi; @@ -566,8 +571,8 @@ class Index extends AdminBase $mf[$mf_v['id']]['jige'] = $mf_v['fenshuxian']['jige']; } - $tjxm_stu = srcTjxm(12211); # 统计项目 - $tjxm_bj = srcTjxm(12212); # 统计项目 + $tjxm_stu = src_tjxm(12211); # 统计项目 + $tjxm_bj = src_tjxm(12212); # 统计项目 $colname = excelColumnName(); // set_time_limit(0); diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index 2d34f374..9dc01d9d 100755 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -31,7 +31,7 @@ class Njtongji extends AdminBase $list['kaoshi_id'] = $kaoshi_id; $list['kaoshititle'] = $ksinfo->title; $list['dataurl'] = '/chengji/njtj/data'; - $list['tjxm'] = srcTjxm(12203); + $list['tjxm'] = src_tjxm(12203); // 模板赋值 @@ -150,7 +150,7 @@ class Njtongji extends AdminBase ->setCategory("成绩管理"); //分类 // 设置导出项目、列表等 - $sbjcol = srcTjxm(12204); + $sbjcol = src_tjxm(12204); $sbjcolcnt = count($sbjcol); $colname = excelColumnName(); $colcnt = $sbjcolcnt * count($xk) + 3; diff --git a/app/chengji/controller/Tongji.php b/app/chengji/controller/Tongji.php index 216eafbb..48972dd1 100755 --- a/app/chengji/controller/Tongji.php +++ b/app/chengji/controller/Tongji.php @@ -27,7 +27,7 @@ class Tongji extends AdminBase $ksset = new \app\kaoshi\model\KaoshiSet; // 重新计算得分率 - $nj = $ksset->srcGrade($src['kaoshi_id']); # 获取参考年级 + $nj = $ksset->srcGrade($src); # 获取参考年级 foreach ($nj as $key => $value) { # 循环获取各年级参考学科 $src['ruxuenian'] = $value['ruxuenian']; $manfen = $ksset->srcSubject($src); # 获取本年级各学科满分 diff --git a/app/chengji/model/Chengji.php b/app/chengji/model/Chengji.php index 819abf10..54675502 100755 --- a/app/chengji/model/Chengji.php +++ b/app/chengji/model/Chengji.php @@ -8,12 +8,35 @@ use \app\BaseModel; class Chengji extends BaseModel { + // 设置字段信息 + protected $schema = [ + 'id' => 'int' + ,'kaohao_id' => 'int' + ,'user_id' => 'int' + ,'user_group' => 'varchar' + ,'subject_id' => 'int' + ,'defen' => 'decimal' + ,'defenlv' => 'decimal' + ,'bpaixu' => 'int' + ,'bweizhi' => 'decimal' + ,'xpaixu' => 'int' + ,'xweizhi' => 'decimal' + ,'qpaixu' => 'int' + ,'qweizhi' =>' decimal' + ,'create_time' =>'int' + ,'update_time' => 'int' + ,'delete_time' => 'int' + ,'status' => 'tinyint' + ]; + + // 学科关联 public function subjectName() { return $this->belongsTo('\app\teach\model\Subject','subject_id','id'); } + // 学科关联 public function cjAdmin() { @@ -41,9 +64,9 @@ class Chengji extends BaseModel ,'user_group' =>'' ); $src = array_cover($srcfrom, $src) ; - $src['kaoshi_id'] = strToarray($src['kaoshi_id']); - $src['banji_id'] = strToarray($src['banji_id']); - $src['subject_id'] = strToarray($src['subject_id']); + $src['kaoshi_id'] = str_to_array($src['kaoshi_id']); + $src['banji_id'] = str_to_array($src['banji_id']); + $src['subject_id'] = str_to_array($src['subject_id']); $khid = array(); if(count($src['kaoshi_id']) > 0 || count($src['banji_id']) > 0 || strlen($src['searchval']) > 0) diff --git a/app/chengji/model/Tongji.php b/app/chengji/model/Tongji.php index af46e04f..861643a7 100755 --- a/app/chengji/model/Tongji.php +++ b/app/chengji/model/Tongji.php @@ -7,10 +7,10 @@ use \app\BaseModel; class Tongji extends BaseModel { + // 统计成绩 public function tongjiCnt($cj = array(), $subject_id) { - // halt($cj); $data = array(); // 循环统计各学科成绩 foreach ($subject_id as $key => $value) { diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 3aa0af07..bbc71013 100755 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -17,6 +17,35 @@ use \app\kaoshi\model\KaoshiSet as ksset; */ class TongjiBj extends BaseModel { + // 设置字段信息 + protected $schema = [ + 'id' => 'int' + ,'kaoshi_id' => 'int' + ,'teacher_id' => 'int' + ,'banji_id' => 'int' + ,'subject_id' => 'int' + ,'stu_cnt' => 'int' + ,'chengji_cnt' => 'int' + ,'sum' => 'decimal' + ,'avg' => 'decimal' + ,'defenlv' => 'decimal' + ,'biaozhuncha' => 'decimal' + ,'youxiu' => 'int' + ,'jige' => 'int' + ,'max' => 'decimal' + ,'min' => 'decimal' + ,'q1' => 'decimal' + ,'q2' => 'decimal' + ,'q3' => 'decimal' + ,'zhongshu' => 'varchar' + ,'zhongweishu' => 'decimal' + ,'create_time' => 'int' + ,'update_time' => 'int' + ,'delete_time' => 'int' + ,'status' => 'tinyint' + ]; + + // 统计参加本次考试所有班级的成绩并保存 public function tjBanji($kaoshi_id) { @@ -26,7 +55,11 @@ class TongjiBj extends BaseModel $more = new More(); $cy = new Canyu(); $ksset = new ksset(); - $nianji = $ksset->srcGrade($kaoshi_id); + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; + $nianji = $ksset->srcGrade($src); // 循环年级统计结果 $data = array(); @@ -122,8 +155,8 @@ class TongjiBj extends BaseModel ); $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToArray($src['banji_id']); - $src['school_id'] = strToArray($src['school_id']); + $src['banji_id'] = str_to_array($src['banji_id']); + $src['school_id'] = str_to_array($src['school_id']); // 实例化学生成绩统计类 $tj = new TJ(); @@ -183,7 +216,7 @@ class TongjiBj extends BaseModel ); $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToArray($src['banji_id']); + $src['banji_id'] = str_to_array($src['banji_id']); // 实例化学生成绩统计类 $tj = new TJ; @@ -295,7 +328,7 @@ class TongjiBj extends BaseModel ] ); $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToarray($src['banji_id']); + $src['banji_id'] = str_to_array($src['banji_id']); $kaoshi_id = $src['kaoshi_id']; if(count($src['banji_id']) == 0){ @@ -356,9 +389,9 @@ class TongjiBj extends BaseModel ,'teacher_id' => '' ); $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToarray($src['banji_id']); - $src['subject_id'] = strToarray($src['subject_id']); - $src['teacher_id'] = strToarray($src['teacher_id']); + $src['banji_id'] = str_to_array($src['banji_id']); + $src['subject_id'] = str_to_array($src['subject_id']); + $src['teacher_id'] = str_to_array($src['teacher_id']); $data = $this->where('kaoshi_id', $src['kaoshi_id']) ->when(count($src['banji_id']) > 0, function ($query) use($src) { @@ -401,9 +434,9 @@ class TongjiBj extends BaseModel ,'enddate' => '' ); $src = array_cover($srcfrom, $src); - $src['xueqi_id'] = strToarray($src['xueqi_id']); - $src['subject_id'] = strToarray($src['subject_id']); - $src['category_id'] = strToarray($src['category_id']); + $src['xueqi_id'] = str_to_array($src['xueqi_id']); + $src['subject_id'] = str_to_array($src['subject_id']); + $src['category_id'] = str_to_array($src['category_id']); if(isset($srcfrom['bfdate']) && strlen($srcfrom['bfdate'])>0) { @@ -528,8 +561,8 @@ class TongjiBj extends BaseModel ,'searchval' => '' ); $src = array_cover($srcfrom, $src); - $src['xueqi_id'] = strToarray($src['xueqi_id']); - $src['category_id'] = strToarray($src['category_id']); + $src['xueqi_id'] = str_to_array($src['xueqi_id']); + $src['category_id'] = str_to_array($src['category_id']); if(isset($srcfrom['bfdate']) && strlen($srcfrom['bfdate']) > 0) { $src['bfdate'] = $srcfrom['bfdate']; @@ -592,13 +625,14 @@ class TongjiBj extends BaseModel $ksset = new ksset(); $cj = new \app\chengji\model\Chengji; - $nianji = $ksset->srcGrade($kaoshi_id); + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; + $nianji = $ksset->srcGrade($src); $col = ['bpaixu', 'bweizhi']; - $src = array( - 'kaoshi_id' => $kaoshi_id - ,'ruxuenian' => 0 - ); + $src['ruxuenian'] = 0; // 初始化统计结果 $data = array(); diff --git a/app/chengji/model/TongjiNj.php b/app/chengji/model/TongjiNj.php index e5f7392f..e7a1835c 100755 --- a/app/chengji/model/TongjiNj.php +++ b/app/chengji/model/TongjiNj.php @@ -10,6 +10,35 @@ use app\chengji\model\Tongji as TJ; */ class TongjiNj extends BaseModel { + // 设置字段信息 + protected $schema = [ + 'id' => 'int' + ,'school_id' => 'int' + ,'kaoshi_id' => 'int' + ,'ruxuenian' => 'int' + ,'subject_id' => 'int' + ,'stu_cnt' => 'int' + ,'chengji_cnt' => 'int' + ,'sum' => 'decimal' + ,'avg' => 'decimal' + ,'defenlv' => 'decimal' + ,'biaozhuncha' => 'decimal' + ,'youxiu' => 'int' + ,'jige' => 'int' + ,'max' => 'decimal' + ,'min' => 'decimal' + ,'q1' => 'decimal' + ,'q2' => 'decimal' + ,'q3' => 'decimal' + ,'zhongshu' => 'varchar' + ,'zhongweishu' => 'decimal' + ,'create_time' => 'int' + ,'update_time' => 'int' + ,'delete_time' => 'int' + ,'status' => 'tinyint' + ]; + + // 统计所有参加本次考试年级的成绩 public function tjNianji($kaoshi_id) { @@ -25,7 +54,11 @@ class TongjiNj extends BaseModel // } // 查询要统计的年级 $ksset = new \app\kaoshi\model\KaoshiSet; - $njList = $ksset->srcGrade($kaoshi_id); + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; + $njList = $ksset->srcGrade($src); // 实例化学生成绩统计类 $tj = new TJ; @@ -209,14 +242,15 @@ class TongjiNj extends BaseModel $cy = new \app\kaohao\model\SearchCanYu; $more = new \app\kaohao\model\SearchMore; $ksset = new \app\kaoshi\model\KaoshiSet; + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; $cj = new \app\chengji\model\Chengji; - $nianji = $ksset->srcGrade($kaoshi_id); + $nianji = $ksset->srcGrade($src); $col = ['xpaixu', 'xweizhi']; - $src = array( - 'kaoshi_id' => $kaoshi_id - ,'ruxuenian' => 0 - ); + $src['ruxuenian'] = 0; // 循环年级 $data = array(); diff --git a/app/chengji/model/TongjiSch.php b/app/chengji/model/TongjiSch.php index 79c8bd07..94c0b09d 100755 --- a/app/chengji/model/TongjiSch.php +++ b/app/chengji/model/TongjiSch.php @@ -10,6 +10,34 @@ use app\chengji\model\Tongji as TJ; */ class TongjiSch extends BaseModel { + // 设置字段信息 + protected $schema = [ + 'id' => 'int' + ,'kaoshi_id' => 'int' + ,'ruxuenian' => 'int' + ,'subject_id' => 'int' + ,'stu_cnt' => 'int' + ,'chengji_cnt' => 'int' + ,'sum' => 'decimal' + ,'avg' => 'decimal' + ,'defenlv' => 'decimal' + ,'biaozhuncha' => 'decimal' + ,'youxiu' => 'int' + ,'jige' => 'int' + ,'max' => 'decimal' + ,'min' => 'decimal' + ,'q1' => 'decimal' + ,'q2' => 'decimal' + ,'q3' => 'decimal' + ,'zhongshu' => 'varchar' + ,'zhongweishu' => 'decimal' + ,'create_time' => 'int' + ,'update_time' => 'int' + ,'delete_time' => 'int' + ,'status' => 'tinyint' + ]; + + // 统计参加本次考试所有学校成绩 public function tjSchool($kaoshi_id) { @@ -19,7 +47,11 @@ class TongjiSch extends BaseModel $more = new \app\kaohao\model\SearchMore; // 查询要统计的年级 $ksset = new \app\kaoshi\model\KaoshiSet; - $njList = $ksset->srcGrade($kaoshi_id); + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; + $njList = $ksset->srcGrade($src); // 实例化学生成绩统计类 $tj = new TJ; @@ -176,7 +208,11 @@ class TongjiSch extends BaseModel $more = new \app\kaohao\model\SearchMore; $ksset = new \app\kaoshi\model\KaoshiSet; $cj = new \app\chengji\model\Chengji; - $nianji = $ksset->srcGrade($kaoshi_id); + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; + $nianji = $ksset->srcGrade($src); // 循环年级 $data = array(); diff --git a/app/common.php b/app/common.php index 5d68a5c0..efc1af4c 100755 --- a/app/common.php +++ b/app/common.php @@ -82,7 +82,7 @@ */ function str_to_array($str) { - $data = \app\facade\Tools::strToArray($str); + $data = \app\facade\Tools::str_to_array($str); return $data; } @@ -108,7 +108,7 @@ // */ // function reset_array($arr, $srcfrom) // { - // $data = \app\facade\Tools::reSetArray($arr, $srcfrom); + // $data = \app\facade\Tools::reset_data($arr, $srcfrom); // return $data; // } diff --git a/app/kaohao/model/Kaohao.php b/app/kaohao/model/Kaohao.php index d85a67ef..c99e7581 100755 --- a/app/kaohao/model/Kaohao.php +++ b/app/kaohao/model/Kaohao.php @@ -91,8 +91,8 @@ class Kaohao extends BaseModel ,'searchval' => '' ); $src = array_cover($srcfrom, $src); - $src['ruxuenian'] = strToarray($src['ruxuenian']); - $src['subject_id'] = strToarray($src['subject_id']); + $src['ruxuenian'] = str_to_array($src['ruxuenian']); + $src['subject_id'] = str_to_array($src['subject_id']); $manfen = $ksset->search($src) ->visible([ @@ -110,7 +110,7 @@ class Kaohao extends BaseModel public function getBanTitleAttr() { $bj = new \app\teach\model\Banji; - $alias = \app\facade\System::sysClass(); + $alias = \app\facade\System::sysInfo(); if($alias->classalias) { $title = $bj->where('id', $this->getAttr('banji_id'))->value('alias'); diff --git a/app/kaohao/model/SearchCanYu.php b/app/kaohao/model/SearchCanYu.php index ef0c7a13..c82a8dc8 100755 --- a/app/kaohao/model/SearchCanYu.php +++ b/app/kaohao/model/SearchCanYu.php @@ -17,9 +17,16 @@ class SearchCanyu extends BaseModel $src = array( 'kaoshi_id' => '' ,'ruxuenian' => '' + ,'page' => '1' + ,'limit' => '10' + ,'field' => 'school_id' + ,'order' => 'asc' + ,'all' => false ); $src = array_cover($srcfrom, $src); - $src['ruxuenian'] = strToarray($src['ruxuenian']); + $src['ruxuenian'] = str_to_array($src['ruxuenian']); + + $src['orderSql'] = $this->schPaixu($src['field']); $kh = new kh; $schoolList = $kh->where('kaoshi_id', $src['kaoshi_id']) @@ -28,11 +35,16 @@ class SearchCanyu extends BaseModel }) ->with(['cjSchool' => function($query){ $query->field('id, jiancheng, paixu, title') - ->order(['paixu' => 'asc']); + ->order(['paixu' => 'asc']); } ]) ->distinct(true) ->field('school_id') + ->when($src['all'] == false, function ($query) use($src) { + $query + ->page($src['page'], $src['limit']); + }) + ->order($src['orderSql']) ->select(); // 重新整理参加学校信息 @@ -46,11 +58,6 @@ class SearchCanyu extends BaseModel ]; } - if(count($data) > 0) - { - $data = \app\facade\Tools::sortArrByManyField($data, 'paixu', SORT_ASC); - } - return $data; } @@ -70,11 +77,31 @@ class SearchCanyu extends BaseModel ,'ruxuenian' => array() ,'school_id' => array() ,'banji_id' => array() + ,'page' => '1' + ,'limit' => '10' + ,'field' => 'school_id' + ,'order' => 'asc' + ,'all' => false ); $src = array_cover($srcfrom, $src); - $src['school_id'] = strToarray($src['school_id']); - $src['banji_id'] = strToarray($src['banji_id']); - $src['ruxuenian'] = strToarray($src['ruxuenian']); + $src['school_id'] = str_to_array($src['school_id']); + $src['banji_id'] = str_to_array($src['banji_id']); + $src['ruxuenian'] = str_to_array($src['ruxuenian']); + + $src['orderSql'] = $this->schPaixu('school_id'); + $ks = new \app\kaoshi\model\Kaoshi; + $bjdate = $ks->where('id', $src['kaoshi_id'])->value('bfdate'); + $bj = new \app\teach\model\Banji; + $njList = $bj->gradeName($bjdate,'num'); + $bjList = $bj->where('ruxuenian', 'in', $njList) + ->order($src['orderSql']) + ->order(['ruxuenian' => 'asc']) + ->order(['paixu' => 'asc']) + ->column(['id']); + $paixuList = implode('\', \'', $bjList); + $paixuList = "field(banji_id, '". $paixuList. "')"; + $orderSql = \think\facade\Db::raw($paixuList); + // 通过给定参数,从考号表中获取参加考试的班级 $kh = new kh; @@ -101,9 +128,13 @@ class SearchCanyu extends BaseModel ,any_value(school_id) as school_id') ->group('banji_id') ->append(['banjiTitle', 'banTitle']) + ->when($src['all'] == false, function ($query) use($src) { + $query + ->page($src['page'], $src['limit']); + }) + ->order($orderSql) ->select(); - $bj = new \app\teach\model\Banji; $data = array(); foreach ($bjids as $key => $value) { $data[] = [ @@ -116,12 +147,29 @@ class SearchCanyu extends BaseModel 'banjiTitle'=>$value->banjiTitle, ]; } - if(count($data) > 0) - { - $data = \app\facade\Tools::sortArrByManyField($data, 'schPaixu', SORT_ASC, 'paixu', SORT_ASC); - } return $data; } + + /** + * 获取参加考试的班级 + * @access public + * @param number $kaoshi 考试id + * @param number $ruxuenian 入学年 + * @return array 返回班级数据模型 + */ + public function schPaixu($field) + { + $sch = new \app\system\model\School; + $schList = $sch->where('jibie_id', 10203) + ->order(['paixu' => 'asc']) + ->field('id, title, paixu') + ->column(['id']); + $paixuList = implode('\', \'', $schList); + $paixuList = "field(" . $field . ", '". $paixuList. "')"; + $orderSql = \think\facade\Db::raw($paixuList); + return $orderSql; + } + } \ No newline at end of file diff --git a/app/kaohao/model/SearchMore.php b/app/kaohao/model/SearchMore.php index e8af9a45..3a8bf607 100755 --- a/app/kaohao/model/SearchMore.php +++ b/app/kaohao/model/SearchMore.php @@ -29,7 +29,7 @@ class SearchMore extends BaseModel // 用新值替换初始值 $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToArray($src['banji_id']); + $src['banji_id'] = str_to_array($src['banji_id']); // 查询成绩 $kh = new kh(); @@ -86,7 +86,7 @@ class SearchMore extends BaseModel // 用新值替换初始值 $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToArray($src['banji_id']); + $src['banji_id'] = str_to_array($src['banji_id']); // 查询成绩 $kh = new kh(); @@ -301,7 +301,7 @@ class SearchMore extends BaseModel ); // 用新值替换初始值 $src = array_cover($srcfrom, $src); - $src['banji_id'] = strToArray($src['banji_id']); + $src['banji_id'] = str_to_array($src['banji_id']); // 获取考试标签 $kh = new kh; diff --git a/app/kaohao/model/SearchOne.php b/app/kaohao/model/SearchOne.php index db7122db..aed40889 100755 --- a/app/kaohao/model/SearchOne.php +++ b/app/kaohao/model/SearchOne.php @@ -22,9 +22,9 @@ class SearchOne extends BaseModel ,'searchval' => '' ); $src = array_cover($srcfrom, $src); - $src['category_id'] = strToArray($src['category_id']); - $src['xueqi_id'] = strToArray($src['xueqi_id']); - $src['kaoshi_id'] = strToArray($src['kaoshi_id']); + $src['category_id'] = str_to_array($src['category_id']); + $src['xueqi_id'] = str_to_array($src['xueqi_id']); + $src['kaoshi_id'] = str_to_array($src['kaoshi_id']); if(isset($srcfrom['bfdate']) && strlen($srcfrom['bfdate'])>0) { diff --git a/app/kaoshi/controller/Index.php b/app/kaoshi/controller/Index.php index fd3b78d1..6d07c3d1 100755 --- a/app/kaoshi/controller/Index.php +++ b/app/kaoshi/controller/Index.php @@ -435,15 +435,24 @@ class Index extends AdminBase // 获取允许录入成绩的考试 public function srcEditKaoshi() { + $src = [ + 'page' => 1 + ,'limit' => 10 + ,'field' => 'id' + ,'order' => 'desc' + ,'luru' => true + ,'status' => true + ]; $ks = new KS(); - // 获取参考年级 - $data = $ks->order(['id' => 'desc']) - ->field('id, title') - ->where('luru', 1) - ->where('status', 1) - ->select(); - $src = array(); - $data = reSetObject($data, $src); + // 获取考试 + $data = $ks->search($src) + ->visible([ + 'id' + ,'title' + ]); + $src['all'] = true; + $cnt = $ks->search($src)->count(); + $data = reset_data($data, $cnt); return json($data); } } diff --git a/app/kaoshi/controller/KsCanyu.php b/app/kaoshi/controller/KsCanyu.php index 85cf1405..b7f58fee 100644 --- a/app/kaoshi/controller/KsCanyu.php +++ b/app/kaoshi/controller/KsCanyu.php @@ -18,17 +18,17 @@ class KsCanYu extends AdminBase ,'kaoshi_id' => '' ,'page' => '1' ,'limit' => '10' - ,'field' => 'id' + ,'field' => 'school_id' ,'order' => 'desc' ], 'POST'); $cy = new \app\kaohao\model\SearchCanYu; $school = $cy->school($src); $src['all'] = true; - $cnt = $cy->school($src)->count(); - $data = reset_data($data, $cnt); + $cnt = count($cy->school($src)); + $data = reset_data($school, $cnt); - return json($school); + return json($data); } @@ -63,40 +63,43 @@ class KsCanYu extends AdminBase 'school_id' => '' ,'ruxuenian' => '' ,'kaoshi_id' => '' - ,'limit' => 100 + ,'page' => '1' + ,'limit' => '10' + ,'field' => 'school_id' + ,'order' => 'desc' ], 'POST'); $khSrc = new \app\kaohao\model\SearchCanYu; $bj = $khSrc->class($src); $src['all'] = true; - $cnt = $cy->class($src)->count(); - $data = reset_data($data, $cnt); + $cnt = count($khSrc->class($src)); + $data = reset_data($bj, $cnt); - return json($bj); + return json($data); } - // 根据考试ID和年级获取参加考试班级 - public function tjClass() - { - // 获取参数 - $src = $this->request - ->only([ - 'school_id' => '' - ,'ruxuenian' => '' - ,'kaoshi_id' => '' - ,'subject_id' => '' - ,'limit' => 100 - ], 'POST'); + // // 根据考试ID和年级获取参加考试班级 + // public function tjClass() + // { + // // 获取参数 + // $src = $this->request + // ->only([ + // 'school_id' => '' + // ,'ruxuenian' => '' + // ,'kaoshi_id' => '' + // ,'subject_id' => '' + // ,'limit' => 100 + // ], 'POST'); - $khSrc = new \app\chengji\model\TongjiBj; - $bj = $khSrc->searchSubjedt($src); - $src['all'] = true; - $cnt = $khSrc->searchSubjedt($src)->count(); - $data = reset_data($data, $cnt); + // $khSrc = new \app\chengji\model\TongjiBj; + // $bj = $khSrc->searchSubjedt($src); + // $src['all'] = true; + // $cnt = $khSrc->searchSubjedt($src)->count(); + // $data = reset_data($data, $cnt); - return json($bj); - } + // return json($bj); + // } // 根据考试ID和年级获取已经参加本次考试学科 diff --git a/app/kaoshi/controller/LuruFengong.php b/app/kaoshi/controller/LuruFengong.php index 91577364..f7d7e33b 100644 --- a/app/kaoshi/controller/LuruFengong.php +++ b/app/kaoshi/controller/LuruFengong.php @@ -26,9 +26,12 @@ class LuruFengong extends AdminBase $list['kaoshi_id'] = $kaoshi_id; $ksset = new ksset; - $src['kaoshi_id'] = $kaoshi_id; + $src = [ + 'kaoshi_id' => $kaoshi_id + ,'all' => true + ]; $list['subject'] = $ksset->srcSubject($src); - $nj = $ksset->srcGrade($kaoshi_id); + $nj = $ksset->srcGrade($src); $list['nj'] = $nj; $kaoshi = new \app\kaoshi\model\Kaoshi; $list['sj'] = $kaoshi::where('id', $kaoshi_id)->value('bfdate'); @@ -53,7 +56,7 @@ class LuruFengong extends AdminBase ,'ruxuenian' => '' ,'page' => '1' ,'limit' => '10' - ,'field' => 'update_id' + ,'field' => 'update_time' ,'order' => 'asc' ,'searchval' => '' ], 'POST'); @@ -220,7 +223,7 @@ class LuruFengong extends AdminBase ], 'POST'); $lrfg = new \app\kaoshi\model\LuruFengong; $bj = $lrfg->srcMyLuruBanji($src); - $bj = reSetArray($bj, $src); + $bj = reset_data($bj, $src); return json($bj); } @@ -238,7 +241,7 @@ class LuruFengong extends AdminBase ], 'POST'); $lrfg = new \app\kaoshi\model\LuruFengong; $bj = $lrfg->srcMyLuruSubject($src); - $bj = reSetArray($bj, $src); + $bj = reset_data($bj, $src); return json($bj); } } diff --git a/app/kaoshi/model/Kaoshi.php b/app/kaoshi/model/Kaoshi.php index 016b76be..a5a2627f 100755 --- a/app/kaoshi/model/Kaoshi.php +++ b/app/kaoshi/model/Kaoshi.php @@ -32,12 +32,12 @@ class Kaoshi extends BaseModel public function search($srcfrom) { $src = [ - 'field' => 'id' - ,'order' => 'desc' - ,'id' => array() + 'id' => array() ,'zuzhi_id' => array() ,'xueqi_id' => '' ,'category_id' => array() + ,'luru' => '' + ,'status' => '' ,'searchval' => '' ,'page' => 1 ,'limit' => 10 @@ -74,6 +74,12 @@ class Kaoshi extends BaseModel ->when(session('user_id') !=1 && session('user_id') !=2, function($query) use($src){ $query->where('id', 'in', $src['id']); }) + ->when(strlen($src['luru']) > 0, function ($query) use($src) { + $query->where('luru', $src['luru']); + }) + ->when(strlen($src['status']) > 0, function ($query) use($src) { + $query->where('status', $src['status']); + }) ->with( [ 'ksCategory' => function ($query) { diff --git a/app/kaoshi/model/TongjiLog.php b/app/kaoshi/model/TongjiLog.php index efdb69af..564ca59f 100755 --- a/app/kaoshi/model/TongjiLog.php +++ b/app/kaoshi/model/TongjiLog.php @@ -27,8 +27,8 @@ class TongjiLog extends BaseModel public function search($srcfrom) { $src = [ - 'kaoshi_id' => '', - 'cjlast' => 0, + 'kaoshi_id' => '' + ,'cjlast' => 0 ,'page' => 1 ,'limit' => 10 ,'field' => 'id' diff --git a/app/kaoshi/route/kaoshi.php b/app/kaoshi/route/kaoshi.php index 4b7f07f6..5492d4f1 100755 --- a/app/kaoshi/route/kaoshi.php +++ b/app/kaoshi/route/kaoshi.php @@ -85,7 +85,7 @@ Route::group('kscy', function () { Route::rule('school','KsCanyu/school','post'); # 参与学科 Route::rule('grade','KsCanyu/grade','post'); # 参与学科 Route::rule('class','KsCanyu/class','post'); # 参与学科 - Route::rule('tjclass','KsCanyu/tjClass','post'); # 参与学科 + // Route::rule('tjclass','KsCanyu/tjClass','post'); # 参与学科 Route::rule('subject','KsCanyu/subject','post'); # 参与学科 }); diff --git a/app/kaoshi/view/luru_fengong/index.html b/app/kaoshi/view/luru_fengong/index.html index 97676162..67185e87 100644 --- a/app/kaoshi/view/luru_fengong/index.html +++ b/app/kaoshi/view/luru_fengong/index.html @@ -20,7 +20,7 @@
-
diff --git a/app/luru/controller/Index.php b/app/luru/controller/Index.php index 51a1f0fb..75e0a7d6 100755 --- a/app/luru/controller/Index.php +++ b/app/luru/controller/Index.php @@ -59,7 +59,7 @@ class Index extends AdminBase // 根据条件查询数据 $cj = new Chengji; $data = $cj->searchLuru($src); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } @@ -809,7 +809,7 @@ class Index extends AdminBase $cj = new \app\kaohao\model\SearchMore; $data = $cj->srcOnlineEdit($src); // halt($data); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } @@ -901,7 +901,7 @@ class Index extends AdminBase // 统计成绩 $btj = new \app\chengji\model\TongjiBj; $data = $btj->tjBanjiCnt($src); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } diff --git a/app/rongyu/controller/Danwei.php b/app/rongyu/controller/Danwei.php index bc41a745..03241a3b 100755 --- a/app/rongyu/controller/Danwei.php +++ b/app/rongyu/controller/Danwei.php @@ -392,7 +392,7 @@ class Danwei extends AdminBase ]; } } - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } diff --git a/app/student/controller/Index.php b/app/student/controller/Index.php index 503ee7a1..cd80a7ed 100755 --- a/app/student/controller/Index.php +++ b/app/student/controller/Index.php @@ -283,8 +283,6 @@ class Index extends AdminBase ], 'PUT'); $list['id'] = $id; - - // 验证表单数据 $validate = new \app\student\validate\Student; $result = $validate->scene('edit')->check($list); @@ -598,46 +596,34 @@ class Index extends AdminBase } - // 根据学生姓名、首拼、全拼搜索教师信息 + // 根据学生姓名、首拼、全拼搜索学生信息 public function srcStudent() { // 声明结果数组 $data = array(); - $str = input("post.searchval"); - $banji_id = input("post.banji_id"); - $kaoshi = input("post.kaoshi"); - - $src = array(); + // 获取参数 + $src = $this->request + ->only([ + 'kaoshi' => 1 + ,'banji_id' => '' + ,'searchval' => '' + ,'page' => 1 + ,'limit' => 10 + ,'field' => 'id' + ,'order' => 'desc' + ],'POST'); // 判断是否存在数据,如果没有数据则返回。 if(strlen($str) <= 0){ - $data = reSetObject($data, $src); + $data = reset_data($data, 0); return json($data); } // 如果有数据则查询教师信息 - $list = STU::field('id, xingming, shengri, sex') - ->whereOr('xingming|shoupin', 'like', '%' . $str . '%') - ->when(strlen($banji_id) > 0, function ($query) use ($banji_id) { - $query->where('banji_id', $banji_id); - }) - ->when(strlen($kaoshi) > 0, function ($query) use ($kaoshi) { - $query->where('kaoshi', $kaoshi); - }) - ->with( - [ - 'stuBanji' => function ($query) { - $query->field('id, jiancheng') - ->with([ - 'glSchool'=>function($query){ - $query->field('id, title, jiancheng'); - }, - ]); - } - ] - ) - ->append(['age']) - ->select(); + $stu = new STU(); + $list = $stu->searchStr($src); + $src['all'] = true; + $cnt = $stu->searchStr($src)->count(); foreach ($list as $key => $value) { $data[] = [ @@ -647,7 +633,7 @@ class Index extends AdminBase ]; } - $data = reSetArray($data, $src); + $data = reset_data($data, $cnt); return json($data); } diff --git a/app/student/model/Student.php b/app/student/model/Student.php index 85e62b33..1ab7c02b 100755 --- a/app/student/model/Student.php +++ b/app/student/model/Student.php @@ -322,6 +322,47 @@ class Student extends BaseModel } + // 根据学生姓名、首拼、全拼搜索学生信息 + public function searchStr($srcfrom) + { + $src = [ + 'searchval' => '' + ,'banji_id' => '' + ,'kaoshi' => '' + ,'page' => 1 + ,'limit' => 10 + ,'field' => 'id' + ,'order' => 'desc' + ,'all' => false + ]; + $src = array_cover($srcfrom, $src); + + $data = $this->field('id, xingming, shengri, sex') + ->whereOr('xingming|shoupin', 'like', '%' . $src['searchval'] . '%') + ->when(strlen($src['banji_id']) > 0, function ($query) use ($src) { + $query->where('banji_id', $src['banji_id']); + }) + ->when(strlen($src['kaoshi']) > 0, function ($query) use ($src) { + $query->where('kaoshi', $src['kaoshi']); + }) + ->with( + [ + 'stuBanji' => function ($query) { + $query->field('id, jiancheng') + ->with([ + 'glSchool'=>function($query){ + $query->field('id, title, jiancheng'); + }, + ]); + } + ] + ) + ->append(['age']) + ->select(); + return $data; +} + + // 获取全部数据 public function searchAll() { diff --git a/app/studentSearchChengji/controller/Index.php b/app/studentSearchChengji/controller/Index.php index b775cc16..ffd0a2c8 100755 --- a/app/studentSearchChengji/controller/Index.php +++ b/app/studentSearchChengji/controller/Index.php @@ -41,7 +41,7 @@ class Index extends StudentSearchBase $list['student_id'] = session('user_id'); $subject = new \app\teach\model\Subject; $list['sbj'] = $subject->search(['kaoshi' => 1]); - $list['tjxm'] = srcTjxm(12207); + $list['tjxm'] = src_tjxm(12207); // 模板赋值 diff --git a/app/teach/controller/BanZhuRen.php b/app/teach/controller/BanZhuRen.php index 82c02fca..030f3d5d 100755 --- a/app/teach/controller/BanZhuRen.php +++ b/app/teach/controller/BanZhuRen.php @@ -60,7 +60,9 @@ class BanZhuRen extends AdminBase ,'bfdate' ,'update_time' ]); # 查询数据 - $data = reSetObject($data, $src); + $src['all'] = true; + $cnt = $bzr->search($src)->count(); + $data = reset_data($data, $src); // 返回数据 return json($data); diff --git a/app/teach/controller/Banji.php b/app/teach/controller/Banji.php index e55dac7b..22041068 100755 --- a/app/teach/controller/Banji.php +++ b/app/teach/controller/Banji.php @@ -98,7 +98,7 @@ class Banji extends AdminBase */ public function create() { - $alias = \app\facade\System::sysClass(); + $alias = \app\facade\System::sysInfo(); // 设置页面标题 $list['set'] = array( @@ -145,7 +145,7 @@ class Banji extends AdminBase ->max('paixu'); // 获取班级最大数 - $cnfMax = \app\facade\System::sysClass(); + $cnfMax = \app\facade\System::sysInfo(); if($paixumax + $list['bjsum'] > $cnfMax->classmax) # 如果增加班级数超过2个,则少加班级 { @@ -246,24 +246,24 @@ class Banji extends AdminBase if( $caozuo > 0 ) { $bjinfo = bjmod::withTrashed() - ->where('school_id', $thisbj->getData('school_id')) - ->where('ruxuenian', $thisbj->ruxuenian) - ->where('paixu', '>=', $thisbj->paixu) - ->order(['paixu']) - ->limit('2') - ->field('id, paixu, ruxuenian') - ->append(['banjiTitle']) - ->select(); + ->where('school_id', $thisbj->getData('school_id')) + ->where('ruxuenian', $thisbj->ruxuenian) + ->where('paixu', '>=', $thisbj->paixu) + ->order(['paixu']) + ->limit('2') + ->field('id, paixu, ruxuenian') + ->append(['banjiTitle']) + ->select(); }else{ $bjinfo = bjmod::withTrashed() - ->where('school_id', $thisbj->getData('school_id')) - ->where('ruxuenian', $thisbj->ruxuenian) - ->where('paixu', '<=', $thisbj->paixu) - ->order(['paixu' => 'desc']) - ->limit('2') - ->field('id, paixu, ruxuenian') - ->append(['banjiTitle']) - ->select(); + ->where('school_id', $thisbj->getData('school_id')) + ->where('ruxuenian', $thisbj->ruxuenian) + ->where('paixu', '<=', $thisbj->paixu) + ->order(['paixu' => 'desc']) + ->limit('2') + ->field('id, paixu, ruxuenian') + ->append(['banjiTitle']) + ->select(); } // 交换班级排序 @@ -291,7 +291,6 @@ class Banji extends AdminBase // 返回处理结果 return json($data); - } @@ -370,7 +369,7 @@ class Banji extends AdminBase // ,'banTitle' // ] // ]); # 查询数据 - // $data = reSetObject($list, $src); + // $data = reset_data($list, $src); // // 返回数据 // return json($list); @@ -396,7 +395,7 @@ class Banji extends AdminBase return json(['msg' => $msg, 'val' => 0]); } - $sysInfo = \app\facade\System::sysClass(); + $sysInfo = \app\facade\System::sysInfo(); if($sysInfo->classalias == false) { return json(['msg' => '不允许使用班级别名', 'val' => 0]); diff --git a/app/teach/controller/BanjiChengji.php b/app/teach/controller/BanjiChengji.php index a34d51ef..865b23d9 100755 --- a/app/teach/controller/BanjiChengji.php +++ b/app/teach/controller/BanjiChengji.php @@ -57,7 +57,7 @@ class BanjiChengji extends AdminBase $data = $bjcjmod->srcBanjiChengji($src); $bjcjmod = new bjcjmod; $data = $bjcjmod->banjiChengjiList($data); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } diff --git a/app/teach/model/BanZhuRen.php b/app/teach/model/BanZhuRen.php index 1032eba8..9abfe7f6 100755 --- a/app/teach/model/BanZhuRen.php +++ b/app/teach/model/BanZhuRen.php @@ -1,5 +1,4 @@ date("Y-m-d", strtotime("-6 year")) ,'enddate' => date("Y-m-d", strtotime('1 day')) ,'searchval' => '' + ,'page' => 1 + ,'limit' => 10 + ,'field' => 'bfdate' + ,'order' => 'desc' + ,'all' => false ]; $src = array_cover($srcfrom, $src) ; - $src['banji_id'] = strToarray($src['banji_id']); - $src['teacher_id'] = strToarray($src['teacher_id']); + $src['banji_id'] = str_to_array($src['banji_id']); + $src['teacher_id'] = str_to_array($src['teacher_id']); // 查询数据 $data = $this @@ -123,7 +127,11 @@ class BanZhuRen extends BaseModel }, ] ) - ->order(['update_time' => 'desc']) + ->when($src['all'] == false, function ($query) use($src) { + $query + ->page($src['page'], $src['limit']); + }) + ->order([$src['field'] => $src['order']]) ->select(); return $data; diff --git a/app/teach/model/Banji.php b/app/teach/model/Banji.php index 772ead1d..04906199 100755 --- a/app/teach/model/Banji.php +++ b/app/teach/model/Banji.php @@ -144,7 +144,7 @@ class Banji extends BaseModel // 年级-班级关联表 public function glBanZhuRen() { - return $this->hasMany(BanZhuRen::class, 'banji_id', 'id'); + return $this->hasMany(\app\teach\model\BanZhuRen::class, 'banji_id', 'id'); } @@ -221,7 +221,9 @@ class Banji extends BaseModel // 班主任获取器 public function getBzrAttr() { - $bzrList = $this->glBanZhuRen; + $bzrList = $this->glBanZhuRen + ->order('bfdate', 'desc') + ->slice(0,1); $str = ''; if (isset($bzrList[0])) diff --git a/app/tools/controller/Index.php b/app/tools/controller/Index.php index 17b87afc..542e41f8 100755 --- a/app/tools/controller/Index.php +++ b/app/tools/controller/Index.php @@ -72,7 +72,7 @@ class Index extends BaseController * @param str或array $str 表单中获取的参数 * @return array 返回类型 */ - public function strToArray($str = array()) + public function str_to_array($str = array()) { // 如果str是字符串,则转换成数组 if(is_array($str) == false) @@ -133,7 +133,7 @@ class Index extends BaseController * @param str或array $str 表单中获取的参数 * @return array 返回类型 */ - public function reSetArray($arr = array(), $srcfrom) + public function reset_data($arr = array(), $srcfrom) { // 整理变量 $src = [ diff --git a/app/tools/controller/OneStudentChengji.php b/app/tools/controller/OneStudentChengji.php index fbcce965..fb3ceafb 100755 --- a/app/tools/controller/OneStudentChengji.php +++ b/app/tools/controller/OneStudentChengji.php @@ -32,7 +32,7 @@ class OneStudentChengji extends BaseController // 获取学生成绩 $stucj = new STUCJ; $khList = $stucj->oldList($src); - $data = reSetArray($khList, $src); + $data = reset_data($khList, $src); return json($data); } @@ -84,7 +84,7 @@ class OneStudentChengji extends BaseController // 获取学生成绩 $stucj = new STUCJ; $data = $stucj->oneChengji($src); - $data = reSetArray($data, $src); + $data = reset_data($data, $src); return json($data); } diff --git a/app/tools/route/tools.php b/app/tools/route/tools.php index 1d6480f9..4dc22c3c 100755 --- a/app/tools/route/tools.php +++ b/app/tools/route/tools.php @@ -10,20 +10,12 @@ // +---------------------------------------------------------------------- use think\facade\Route; -// // 教师管理 -// Route::group('kscy', function () { -// Route::rule('school','KsCanyu/school','post'); # 参与学科 -// Route::rule('grade','KsCanyu/grade','post'); # 参与学科 -// Route::rule('class','KsCanyu/class','post'); # 参与学科 -// Route::rule('tjclass','KsCanyu/tjClass','post'); # 参与学科 -// Route::rule('subject','KsCanyu/subject','post'); # 参与学科 -// }); - // 教师管理 Route::group('file', function () { Route::rule('upload','File/upload','post'); # 上传文件 }); + // 某个学生成绩 Route::group('onestudentchengji', function () { // Route::rule('data','OneStudentChengji/ajaxData','post'); # 上传文件