From 8766edec006dd44664438db968f7f49da97ca808 Mon Sep 17 00:00:00 2001 From: cxdbz Date: Fri, 30 Nov 2018 22:27:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E7=BB=A9=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chengji/controller/Index.php | 1 + application/chengji/model/Chengji.php | 25 +++++++++++-------- .../chengji/view/index/chengjilist.html | 6 ++--- application/kaoshi/controller/MoreAction.php | 2 +- .../kaoshi/view/more_action/index.html | 11 +++++--- 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/application/chengji/controller/Index.php b/application/chengji/controller/Index.php index feed0efa..888aaddd 100644 --- a/application/chengji/controller/Index.php +++ b/application/chengji/controller/Index.php @@ -181,6 +181,7 @@ class Index extends Base } + // 获取考试信息 public function ajaxData() { diff --git a/application/chengji/model/Chengji.php b/application/chengji/model/Chengji.php index ca723817..c9e19193 100644 --- a/application/chengji/model/Chengji.php +++ b/application/chengji/model/Chengji.php @@ -49,7 +49,7 @@ class Chengji extends Base // 学校信息关联表 - public function cjschool() + public function cjSchool() { return $this->belongsTo('\app\system\model\School','school','id'); } @@ -104,7 +104,8 @@ class Chengji extends Base // 班级名称(数字)获取器 public function getBanjiNumnameAttr() { - $bj = Banji::find($this->getdata('banji')); + $bj = new \app\teach\model\Banji; + $bj = $bj->find($this->getdata('banji')); // 返回班级名称 return $bj->numTitle; @@ -127,7 +128,11 @@ class Chengji extends Base //得到排序字段的下标 $order_column = $getdt['order'][0]['column']; //根据排序字段的下标得到排序字段 - $order_field = $getdt['columns'][$order_column]['data']; + $order_field = $getdt['columns'][$order_column]['name']; + if($order_field=='') + { + $order_field = $getdt['columns'][$order_column]['data']; + } //得到limit参数 $limit_start = $getdt['start']; $limit_length = $getdt['length']; @@ -139,7 +144,13 @@ class Chengji extends Base if(trim($search)!='' || $school!='' || $nianji!='') { $data = $this->scope('kaoshi',$kaoshiid) - ->where(function ($query) use($search){ + ->when($school!='',function($query) use($school){ + $query->where('school','in',$school); + }) + ->when($nianji!='',function($query) use($nianji){ + $query->where('nianji','in',$nianji); + }) + ->where(function ($query) use($search){ $query->whereOr('student','in',function ($query) use($search){ $query->name('student')->where('xingming','like','%'.$search.'%')->field('id'); }) @@ -147,12 +158,6 @@ class Chengji extends Base $query->name('school')->where('title|jiancheng','like','%'.$search.'%')->field('id'); }); }) - ->when($school!='',function($query) use($school){ - $query->where('school','in',$school); - }) - ->when($nianji!='',function($query) use($nianji){ - $query->where('nianji','in',$nianji); - }) ->order([$order_field=>$order]) ->limit($limit_start,$limit_length) ->select(); diff --git a/application/chengji/view/index/chengjilist.html b/application/chengji/view/index/chengjilist.html index e3f338b0..a1bf0197 100644 --- a/application/chengji/view/index/chengjilist.html +++ b/application/chengji/view/index/chengjilist.html @@ -130,9 +130,9 @@ // 定义列参数 var mycolumns = [ { "data": "id" }, - { "data": "cj_school.jiancheng" }, - { "data": "cj_banji.title" }, - { "data": "cj_student.xingming"}, + { "data": "cj_school.jiancheng","name":"school" }, + { "data": "cj_banji.title","name":"banji" }, + { "data": "cj_student.xingming","name":"student"}, { "data": "yuwen"}, { "data": "shuxue"}, { "data": "waiyu" }, diff --git a/application/kaoshi/controller/MoreAction.php b/application/kaoshi/controller/MoreAction.php index 861efc82..134658ba 100644 --- a/application/kaoshi/controller/MoreAction.php +++ b/application/kaoshi/controller/MoreAction.php @@ -158,7 +158,7 @@ class MoreAction extends Base // 设置图片格式 - $imageStyle = array('width'=>42,'height'=>42,'align'=>'left'); + $imageStyle = array('width'=>45,'height'=>45,'align'=>'left'); // 学生信息样式 $myStyle = 'myStyle'; diff --git a/application/kaoshi/view/more_action/index.html b/application/kaoshi/view/more_action/index.html index 3041b921..bd50f865 100644 --- a/application/kaoshi/view/more_action/index.html +++ b/application/kaoshi/view/more_action/index.html @@ -48,11 +48,11 @@ @@ -91,6 +91,11 @@ fontSize:'50px', }); }); + $('h1').mouseleave(function(){ + $(this).animate({ + fontSize:'36px', + }); + }); {/block} \ No newline at end of file