From cde37e905d0cb07a1d998a473883097e92cc19d1 Mon Sep 17 00:00:00 2001 From: cxdbz Date: Mon, 17 Jun 2019 08:26:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=88=90=E7=BB=A9=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A8=A1=E5=9E=8B=E9=87=8D=E5=A4=8D=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chengji/model/Chengji.php | 88 --------------------------- application/common.php | 3 + 2 files changed, 3 insertions(+), 88 deletions(-) diff --git a/application/chengji/model/Chengji.php b/application/chengji/model/Chengji.php index a2797a69..1dc31e62 100644 --- a/application/chengji/model/Chengji.php +++ b/application/chengji/model/Chengji.php @@ -15,94 +15,6 @@ class Chengji extends Base return $this->belongsTo('\app\teach\model\Subject'); } - // /** - // * 根据考试ID和班级获取学生各学科成绩、平均分、总分 - // * - // * @access public - // * @param mixed $kaoshi 当前考试ID - // * @param array $banji 学生所在班级 - // * @return array 返回类型 - // */ - // public function srcChengji($kaoshi=0,$banji=array()) - // { - // $kh = new \app\kaoshi\model\Kaohao; - // $khlist = $kh->where('kaoshi',$kaoshi) - // ->field('id,school,student,nianji,banji') - // ->when(count($banji)>0,function($query) use($banji){ - // $query->where('banji','in',$banji); - // }) - // ->with([ - // 'ksChengji'=>function($query){ - // $query->field('kaohao_id,subject_id,defen'); - // } - // ,'cjBanji'=>function($query){ - // $query->field('id,paixu,ruxuenian') - // ->append(['numTitle','banjiTitle']); - // } - // ,'cjSchool'=>function($query){ - // $query->field('id,jiancheng'); - // } - // ,'cjStudent'=>function($query){ - // $query->field('id,xingming,sex'); - // } - // ]) - // ->select(); - - - // // 获取参考学科 - // $ks = new \app\kaoshi\model\Kaoshi; - // $ksinfo = $ks->where('id',$kaoshi) - // ->with([ - // 'ksSubject'=>function($query){ - // $query->field('kaoshiid,subjectid,lieming'); - // } - // ]) - // ->find(); - // $xk = array(); - // foreach ($ksinfo->ks_subject as $key => $value) { - // $xk[$value->subjectid] = $value->lieming; - // } - - - // // 整理数据 - // $data = array(); - // foreach ($khlist as $key => $value) { - // $data[$key]['id'] = $value->id; - // $data[$key]['school'] = $value->cj_school->jiancheng; - // if(isset($value->cj_student)){ - // $data[$key]['student'] = $value->cj_student->xingming; - // $data[$key]['sex'] = $value->cj_student->sex; - // }else{ - // $stu = new \app\renshi\model\Student; - // $stuname = $stu::withTrashed()->where('id',$value->student)->field('id,xingming,sex')->find(); - // $data[$key]['student'] = $stuname->xingming; - // $data[$key]['sex'] = $stuname->sex; - // } - // $data[$key]['nianji'] = $value->nianji; - // $data[$key]['banji'] = $value->cj_banji->banji_title; - // $dfsum = 0; - // $sbjcnt = 0; - // foreach ($value->ks_chengji as $k => $val) { - // $data[$key][$xk[$val->subject_id]] = $val->defen*1; - // $dfsum = $dfsum + $val->defen*1; - // $sbjcnt ++; - // } - // $data[$key]['sum'] = $dfsum; - // if($sbjcnt>0){ - // $data[$key]['avg'] = round($dfsum/$sbjcnt,1); - // }else{ - // $data[$key]['avg'] = 0; - // } - // } - - // // // 按条件排序 - // // if(count($data)>0){ - // // $data = arraySequence($data,$src['field'],$src['type']); //排序 - // // } - // return $data; - // } - - // 学科关联 public function subjectName() { diff --git a/application/common.php b/application/common.php index 445e8b40..ce2dc2d2 100644 --- a/application/common.php +++ b/application/common.php @@ -67,6 +67,9 @@ function nianjiList() $njlist[$nian-3]='四年级'; $njlist[$nian-4]='五年级'; $njlist[$nian-5]='六年级'; + $njlist[$nian-6]='七年级'; + $njlist[$nian-5]='八年级'; + $njlist[$nian-5]='九年级'; return $njlist; }