diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 68907ba0..d5d047b7 100644 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -340,6 +340,7 @@ class TongjiBj extends BaseModel ->where('banji_id', $src['banji_id']) ->where('kaoshi_id', 'in', function ($query) use ($src) { $query->name('kaoshi') + ->where('luru&status', '0') ->whereTime('bfdate|enddate', 'between', [$src['bfdate'], $src['enddate']]) ->when(count($src['xueqi_id']) > 0, function($q) use ($src) { $q->where('xueqi_id', 'in', function($w) use ($src) { diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index 5fc8e6be..aeeb26d9 100644 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -76,8 +76,8 @@ class Index extends AdminBase ]); // 获取参加考试年级数组 - $bfdate = KS::where('id', $list['kaoshi_id'])->value('bfdate'); - $njlist = nianJiNameList($bfdate); + $enddate = KS::where('id', $list['kaoshi_id'])->value('enddate'); + $njlist = nianJiNameList('str', $enddate); // 重新组合学生信息 $kaohao = array(); foreach ($stulist as $key => $value) { diff --git a/app/kaohao/model/SearchCanYu.php b/app/kaohao/model/SearchCanYu.php index f7f9ecb6..95cce61f 100644 --- a/app/kaohao/model/SearchCanYu.php +++ b/app/kaohao/model/SearchCanYu.php @@ -23,27 +23,26 @@ class SearchCanyu extends BaseModel $kh = new kh; $schoolList = $kh->where('kaoshi_id', $src['kaoshi_id']) - ->when(count($src['ruxuenian']) > 0, function($query) use($src){ - $query->where('ruxuenian', 'in', $src['ruxuenian']); - }) - ->with(['cjSchool' => function($query){ - $query->field('id, jiancheng, paixu, title') - ->order(['paixu' => 'asc']); - } - ]) - ->group('school_id') - ->field('school_id') - ->select() - ->toArray(); + ->when(count($src['ruxuenian']) > 0, function($query) use($src){ + $query->where('ruxuenian', 'in', $src['ruxuenian']); + }) + ->with(['cjSchool' => function($query){ + $query->field('id, jiancheng, paixu, title') + ->order(['paixu' => 'asc']); + } + ]) + ->group('school_id') + ->field('school_id') + ->select(); // 重新整理参加学校信息 $data = array(); foreach ($schoolList as $key => $value) { $data[] = [ - 'paixu' => $value['cjSchool']['paixu'], - 'id' => $value['cjSchool']['id'], - 'title' => $value['cjSchool']['title'], - 'jiancheng' => $value['cjSchool']['jiancheng'], + 'paixu' => $value->cjSchool->paixu, + 'id' => $value->cjSchool->id, + 'title' => $value->cjSchool->title, + 'jiancheng' => $value->cjSchool->jiancheng, ]; } diff --git a/app/kaohao/model/SearchOne.php b/app/kaohao/model/SearchOne.php index 69c293b3..65245500 100644 --- a/app/kaohao/model/SearchOne.php +++ b/app/kaohao/model/SearchOne.php @@ -15,10 +15,11 @@ class SearchOne extends BaseModel { // 初始化参数 $src = array( - 'student_id' => '', - 'category_id' => '', - 'xueqi_id' => '', - 'kaoshi_id' => '', + 'student_id' => '' + ,'category_id' => '' + ,'xueqi_id' => '' + ,'kaoshi_id' => '' + ,'searchval' => '' ); $src = array_cover($srcfrom, $src); $src['category_id'] = strToArray($src['category_id']); @@ -41,30 +42,26 @@ class SearchOne extends BaseModel $kh = new kh; $stuCj = $kh->where('student_id',$src['student_id']) - ->when(count($src['category_id'])>0, function($query) use($src){ - $query->where('kaoshi_id','in',function($q) use($src){ - $q->name('kaoshi') - ->where('category_id','in',$src['category_id']) - ->field('id'); - }); - }) - ->when(count($src['xueqi_id'])>0, function($query) use($src){ - $query->where('kaoshi_id','in',function($q) use($src){ - $q->name('kaoshi') - ->where('xueqi_id','in',function($w) use($src){ - $w->name('xueqi') - ->where('category_id','in',$src['xueqi_id']) - ->field('id'); - }) - ->field('id'); - }); - }) - ->when(count($src['kaoshi_id'])>0, function($query) use($src){ - $query->where('kaoshi_id', 'in', $src['kaoshi_id']); - }) ->where('kaoshi_id', 'in', function($query) use($src){ $query->name('kaoshi') - ->whereTime('bfdate|enddate', 'between', [ $src['bfdate'],$src['enddate'] ]) + ->whereTime('bfdate|enddate', 'between', [$src['bfdate'], $src['enddate']]) + ->where('luru&status', '0') + ->when(count($src['kaoshi_id'])>0, function($w) use($src){ + $w->where('id', 'in', $src['kaoshi_id']); + }) + ->when(strlen($src['searchval'])>0, function($w) use($src){ + $w->where('title', 'like', '%' . $src['searchval'] . '%'); + }) + ->when(count($src['category_id'])>0, function($w) use($src){ + $w->where('category_id', 'in', $src['category_id']); + }) + ->when(count($src['xueqi_id'])>0, function($w) use($src){ + $w->where('xueqi_id', 'in', function($q) use($src){ + $q->name('xueqi') + ->where('category_id', 'in', $src['xueqi_id']) + ->field('id'); + }); + }) ->field('id'); }) ->with([ diff --git a/app/kaoshi/view/index/more_action.html b/app/kaoshi/view/index/more_action.html index b1a67455..87c8cf92 100644 --- a/app/kaoshi/view/index/more_action.html +++ b/app/kaoshi/view/index/more_action.html @@ -61,6 +61,13 @@
您现在使用的是默认密码,为了您的信息不被漏,请及时修改密码。{/if} -