From 2a6705357854b277d636a920be5e72eac519f44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Sun, 29 Sep 2019 09:38:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=80=83=E8=AF=95=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E6=93=8D=E4=BD=9C=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chengji/controller/Index.php | 83 ++++++++++- application/chengji/view/index/deletecjs.html | 139 ++++++++++++++++++ application/chengji/view/index/index.html | 14 +- .../kaoshi/view/index/more_action.html | 31 +++- application/renshi/controller/Student.php | 17 ++- route/chengji.php | 4 + 6 files changed, 275 insertions(+), 13 deletions(-) create mode 100644 application/chengji/view/index/deletecjs.html diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index aca1ec92..fcca1cfc 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -406,8 +406,75 @@ class Index extends Base } + // 下载成绩表格 + public function deletecjs($kaoshi) + { - // 删除成绩 + // 设置页面标题 + $list['set'] = array( + 'webtitle'=>'批量删除成绩', + 'butname'=>'删除', + 'formpost'=>'POST', + 'url'=>'/deletecjmore', + 'kaoshi'=>$kaoshi + ); + + $ks = new \app\kaoshi\model\Kaoshi; + $subject = $ks + ->where('id',$kaoshi) + ->with([ + 'ksSubject'=>function($query){ + $query->field('kaoshiid,subjectid') + ->with(['subjectName'=>function($q){ + $q->field('id,title'); + }] + ); + } + ]) + ->find() + ->toArray(); + $list['subject'] = $subject['ks_subject']; + + // 模板赋值 + $this->assign('list',$list); + // 渲染 + return $this->fetch(); + } + + + // 按条件删除成绩 + public function deletecjmore() + { + // 获取参数 + $src = $this->request + ->only(['kaoshi','banji','subject'],'POST'); + $banji = $src['banji']; + + // 获取要删除成绩的考号 + $kaohao = new \app\kaoshi\model\Kaohao; + $kaohaolist = $kaohao::where('kaoshi',$src['kaoshi']) + ->where('banji','in',$src['banji']) + ->column('student'); + + // 查询成绩id + $chengjilist = Chengji::where('kaohao_id','in',$kaohaolist) + ->where('subject_id','in',$src['subject']) + ->column('id'); + // 删除成绩 + $data = Chengji::destroy($chengjilist); + + // 根据更新结果设置返回提示信息 + $data ? $data=['msg'=>'成绩删除成功','val'=>1] : $data=['msg'=>'数据处理错误','val'=>0]; + + // 返回信息 + return json($data); + } + + + + + + // 删除考号 public function delete($id) { @@ -428,6 +495,7 @@ class Index extends Base + // 设置成绩状态 public function setStatus() { @@ -448,6 +516,9 @@ class Index extends Base + + + // 下载成绩表格 public function dwChengji($kaoshi) { @@ -468,6 +539,9 @@ class Index extends Base } + + + //生成学生表格 public function dwchengjixls() { @@ -613,6 +687,9 @@ class Index extends Base } + + + // 学生成绩录入信息 public function readAdd($kaohao) { @@ -627,6 +704,10 @@ class Index extends Base return $this->fetch(); } + + + + // ajax获取学生成绩录入信息 public function ajaxaddinfo() { diff --git a/application/chengji/view/index/deletecjs.html b/application/chengji/view/index/deletecjs.html new file mode 100644 index 00000000..ff48dff2 --- /dev/null +++ b/application/chengji/view/index/deletecjs.html @@ -0,0 +1,139 @@ +{extend name="common@create" /} + +{block name="form"} +
+
+ +
+ {volist name="list.subject" id="vo"} + + {/volist} + +
+
+ + +
+ +
+ {php} $schoollist = schlist('校级','校级',['小学','中小学']);{/php} + +
+
+
+ +
+ {php} $njlist = nianjiList();{/php} + +
+
+
+ +
+
+
+ +
+ +
+
+{/block} + +{block name="myjs"} + +{/block} + diff --git a/application/chengji/view/index/index.html b/application/chengji/view/index/index.html index 690abe27..8e0d4f5d 100644 --- a/application/chengji/view/index/index.html +++ b/application/chengji/view/index/index.html @@ -74,10 +74,10 @@