From 44d0336cb0d49fa2cea0bc64c44ca8b26fbff7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=E5=93=A5?= Date: Fri, 22 Oct 2021 12:15:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E4=B8=8B=E8=BD=BD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/model/TongjiBj.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index 3aa0af07..abdc0e77 100755 --- a/app/chengji/model/TongjiBj.php +++ b/app/chengji/model/TongjiBj.php @@ -679,17 +679,16 @@ class TongjiBj extends BaseModel public function getBanjiTitleAttr() { $ks = new \app\kaoshi\model\Kaoshi; - $ksInfo = $ks->where('id', $this->getAttr('kaoshi_id')) + $riqi = $ks->where('id', $this->getAttr('kaoshi_id')) ->field('id, enddate') - ->find(); + ->value('enddate'); $bj = new \app\teach\model\Banji; $bjInfo = $bj->where('id', $this->getAttr('banji_id')) ->field('id, ruxuenian, alias, paixu') ->append(['banTitle']) ->find(); - - $njlist = \app\facade\Tools::nianJiNameList($ksInfo->getData('enddate'), 'str'); + $njlist = \app\facade\Tools::nianJiNameList($riqi, 'str'); $njname = $njlist[$bjInfo->ruxuenian]; $title = $njname . $bjInfo->banTitle; From 636620fa36f696d6e645469a5d3a407036989e4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=BA=E5=93=A5?= Date: Fri, 22 Oct 2021 16:45:07 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=88=90=E7=BB=A9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/controller/Bjtongji.php | 7 +++++++ app/chengji/model/TongjiBj.php | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/chengji/controller/Bjtongji.php b/app/chengji/controller/Bjtongji.php index 20691bdc..4779a620 100755 --- a/app/chengji/controller/Bjtongji.php +++ b/app/chengji/controller/Bjtongji.php @@ -133,6 +133,7 @@ class Bjtongji extends AdminBase 'kaoshi_id' => '' ,'ruxuenian' => '' ,'school_id' => array() + ,'auth' => [] ], 'POST'); $src['school_id'] = strToarray($src['school_id']); @@ -159,6 +160,12 @@ 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); diff --git a/app/chengji/model/TongjiBj.php b/app/chengji/model/TongjiBj.php index abdc0e77..a8b4bd20 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']) - ->whereOr('teacher_id', session('user_id')); + ->where('teacher_id', session('user_id')); }) ->field('banji_id, kaoshi_id') ->with([ @@ -688,6 +688,7 @@ class TongjiBj extends BaseModel ->field('id, ruxuenian, alias, paixu') ->append(['banTitle']) ->find(); + $njlist = \app\facade\Tools::nianJiNameList($riqi, 'str'); $njname = $njlist[$bjInfo->ruxuenian]; $title = $njname . $bjInfo->banTitle; From 3b4ce2a160cbbf78abccdce27194bfcfdabe5fd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=93=9C=E5=93=A5?= Date: Sun, 24 Oct 2021 17:07:30 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=88=90=E7=BB=A9=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B7=BB=E5=8A=A0=E8=80=83=E5=8F=B7=E4=B8=AD?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E6=9D=83=E9=99=90=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chengji/controller/Bjtongji.php | 9 +-------- app/chengji/model/TongjiBj.php | 8 ++++---- app/kaohao/model/SearchOne.php | 2 +- app/kaohao/view/index/create_all.html | 6 ++++++ 4 files changed, 12 insertions(+), 13 deletions(-) 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); } From d584e2e1442561e6ab35a5bf16b2ff0cb1ab64e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=93=9C=E5=93=A5?= Date: Sun, 24 Oct 2021 17:15:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=80=83=E5=8F=B7=E6=97=B6=E7=9A=84=E6=9D=83=E9=99=90=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/kaohao/view/index/create.html | 6 ++++++ app/kaoshi/view/index/create_setp3.html | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/kaohao/view/index/create.html b/app/kaohao/view/index/create.html index b1bb98d7..d3c9aad5 100755 --- a/app/kaohao/view/index/create.html +++ b/app/kaohao/view/index/create.html @@ -63,6 +63,12 @@ layui.use(['form', 'canyuKaoshi', 'createInput'], function() { // 监听学校下拉菜单 form.on('select(nj)', 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.banjiSelect('banji_id', data); } diff --git a/app/kaoshi/view/index/create_setp3.html b/app/kaoshi/view/index/create_setp3.html index 76d375b5..4bd49210 100644 --- a/app/kaoshi/view/index/create_setp3.html +++ b/app/kaoshi/view/index/create_setp3.html @@ -74,6 +74,12 @@ layui.use(['form', 'createInput', 'canyuKaoshi'], function() { form.on('select()', 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); } From 4b841e4f354849e6c945b386fc07eeeb6f1aff44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=93=9C=E5=93=A5?= Date: Sun, 24 Oct 2021 17:31:03 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E6=88=90?= =?UTF-8?q?=E8=80=83=E5=8F=B7=E6=97=B6=E7=9A=84=E6=9D=83=E9=99=90=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/kaohao/controller/Index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/kaohao/controller/Index.php b/app/kaohao/controller/Index.php index 7e63c9bd..0e29a822 100755 --- a/app/kaohao/controller/Index.php +++ b/app/kaohao/controller/Index.php @@ -64,7 +64,11 @@ class Index extends AdminBase ,'status' => 1 ]; - $src['auth'] = event('mybanji', array()); + $src['auth'] = event('mybanji', array( + 'guanliyuan' => false + ,'zhiwu' => false + ,'zuzhang' => false + ,'banzhuren' => false)); $src['auth'] = $src['auth'][0]; $src['auth']['banji_id'] = array_intersect($src['auth']['banji_id'], $src['banji_id']);