diff --git a/app/teach/model/BanZhuRen.php b/app/teach/model/BanZhuRen.php index e1f68060..4f6bf695 100644 --- a/app/teach/model/BanZhuRen.php +++ b/app/teach/model/BanZhuRen.php @@ -42,18 +42,24 @@ class BanZhuRen extends BaseModel // 查询任职结束时间 public function getJieShuAttr() { - $str = ''; - // 根据当前记录时间查询结束时间 - $js = $this - ->where('banji_id', $this->banji_id) - ->where('bfdate', '>', $this->getData('bfdate')) - ->order(['bfdate' => 'asc']) - ->find(); - if($js) + $str = '现在'; + + if($this->glBanji->biye === true) { - $str = $js->bfdate; + $str = $this->glBanji->ruxuenian . '-8-1'; + }else{ + // 根据当前记录时间查询结束时间 + $js = $this + ->where('banji_id', $this->banji_id) + ->where('bfdate', '>', $this->getData('bfdate')) + ->order(['bfdate' => 'asc']) + ->find(); + if($js) + { + $str = $js->bfdate; + } } - + return $str; } @@ -130,7 +136,7 @@ class BanZhuRen extends BaseModel ->order(['update_time'=>'desc']) ->with([ 'glBanji' => function ($query) { - $query->field('id, ruxuenian, paixu')->append(['banJiTitle, biye']); + $query->field('id, ruxuenian, paixu')->append(['banJiTitle', 'biye']); } ]) ->append(['jieShu']) diff --git a/app/teacher/view/index/read.html b/app/teacher/view/index/read.html index 43e4d914..e06a484e 100644 --- a/app/teacher/view/index/read.html +++ b/app/teacher/view/index/read.html @@ -255,7 +255,7 @@ }}, ]] }); - + //第三个实例 bzr = table.render(options); //获取数据并渲染 var bzr =table.render({ @@ -267,17 +267,22 @@ } ,cols: [[ //表头 {field:'id', type:'numbers',sort:true,width:100,title:'序号'} - ,{field: 'title',sort:true, title: '开始时间', minWidth:200} - ,{field: 'title',sort:true, title: '班级名称', minWidth:200} - ,{field: 'bianhao',sort:true, title: '学科'} - ,{field: 'jddengji_id', title: '鉴定结果', sort: true, minWidth:100,templet:function(d){ + ,{field: 'bfdate',sort:true, title: '任职时间', minWidth:200,templet:function(d){ var str=''; - if(d.ktJdDengji) + str = d.bfdate + ' ~ ' + d.jieShu; + return str; + }} + ,{field: 'banji_id',sort:true, title: '任职班级', minWidth:200,templet:function(d){ + var str=''; + if(d.glBanji) { - str = d.ktJdDengji.title; + if(d.glBanji.banJiTitle) + { + str = d.glBanji.banJiTitle; + } } return str; - }}, + }} ]] });