diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 4779a620..10480430 100755 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -133,7 +133,6 @@ class Bjtongji extends AdminBase 'kaoshi_id' => '' ,'ruxuenian' => '' ,'school_id' => array() - ,'auth' => [] ], 'POST'); $src['school_id'] = strToarray($src['school_id']); @@ -160,12 +159,6 @@ class Bjtongji extends AdminBase } } $btj = new BTJ; # 成绩统计结果 - $src['auth'] = event('mybanji', $src['auth']); - $src['auth'] = $src['auth'][0]; - if(count($src['banji_id']) > 0) # 如果没有获取到班级id,则查询班级id - { - $src['auth']['banji_id'] = array_intersect($src['auth']['banji_id'], $src['banji_id']); - } $data = $btj->search($src); $ntj = new \app\chengji\model\TongjiNj; $dataAll = $ntj->search($src); @@ -187,7 +180,7 @@ class Bjtongji extends AdminBase $sbjcol = srcTjxm(12202); $sbjcolcnt = count($sbjcol); $colname = excelColumnName(); - $colcnt = $sbjcolcnt*count($xk)+3; + $colcnt = $sbjcolcnt * count($xk)+3; // 设置表头信息 $sheet->mergeCells('A1:' . $colname[$colcnt] . '1'); diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index a8b4bd20..3aa0af07 100755 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -307,7 +307,7 @@ class TongjiBj extends BaseModel ->where('banji_id', 'in', $src['banji_id']) ->when($src['auth']['check'] == true, function ($query) use($src) { $query->where('banji_id', 'in', $src['auth']['banji_id']) - ->where('teacher_id', session('user_id')); + ->whereOr('teacher_id', session('user_id')); }) ->field('banji_id, kaoshi_id') ->with([ @@ -679,9 +679,9 @@ class TongjiBj extends BaseModel public function getBanjiTitleAttr() { $ks = new \app\kaoshi\model\Kaoshi; - $riqi = $ks->where('id', $this->getAttr('kaoshi_id')) + $ksInfo = $ks->where('id', $this->getAttr('kaoshi_id')) ->field('id, enddate') - ->value('enddate'); + ->find(); $bj = new \app\teach\model\Banji; $bjInfo = $bj->where('id', $this->getAttr('banji_id')) @@ -689,7 +689,7 @@ class TongjiBj extends BaseModel ->append(['banTitle']) ->find(); - $njlist = \app\facade\Tools::nianJiNameList($riqi, 'str'); + $njlist = \app\facade\Tools::nianJiNameList($ksInfo->getData('enddate'), 'str'); $njname = $njlist[$bjInfo->ruxuenian]; $title = $njname . $bjInfo->banTitle; diff --git a/app/kaohao/model/SearchOne.php b/app/kaohao/model/SearchOne.php index 45304a77..db7122db 100755 --- a/app/kaohao/model/SearchOne.php +++ b/app/kaohao/model/SearchOne.php @@ -45,7 +45,7 @@ class SearchOne extends BaseModel ->where('kaoshi_id', 'in', function($query) use($src){ $query->name('kaoshi') ->whereTime('bfdate|enddate', 'between', [$src['bfdate'], $src['enddate']]) - ->where('luru&status', '1') + ->where('luru&status', '0') ->when(count($src['kaoshi_id'])>0, function($w) use($src){ $w->where('id', 'in', $src['kaoshi_id']); }) diff --git a/app/kaohao/view/index/create_all.html b/app/kaohao/view/index/create_all.html index b81a695e..88a42ffc 100755 --- a/app/kaohao/view/index/create_all.html +++ b/app/kaohao/view/index/create_all.html @@ -40,6 +40,12 @@ layui.use(['form', 'createInput', 'canyuKaoshi'], function() { form.on('select(src)', function(data) { data = form.val("myform"); + data.auth = { + 'guanliyuan' : true + ,'zhiwu' : true + ,'zuzhang' : true + ,'banzhuren' : true + } if (data.school_id > 0 && data.ruxuenian > 0) { cInput.banjiCheckbox('banji_id', data); }