From 40f874239e412a23e88e32a3e4bc99399a15c2cb Mon Sep 17 00:00:00 2001 From: win10 Date: Fri, 12 Jun 2020 10:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/keti/model/KetiInfo.php | 27 ++++++++++++++++++++++----- app/renshi/view/teacher/read.html | 14 +++++++++----- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/app/keti/model/KetiInfo.php b/app/keti/model/KetiInfo.php index 0e7f51fa..d1f983cc 100644 --- a/app/keti/model/KetiInfo.php +++ b/app/keti/model/KetiInfo.php @@ -127,7 +127,7 @@ class KetiInfo extends BaseModel 'ktCategory' => function($query){ $query->field('id, title'); }, - 'ktZcr' => function($query){ + 'ktZcr' => function($query){ $query->field('ketiinfo_id, teacher_id') ->with([ 'teacher' => function($q){ @@ -136,10 +136,24 @@ class KetiInfo extends BaseModel ]); }, 'ktJdDengji' => function($query){ - $query->field('id, title'); - } + $query->field('id, title'); + }, + 'KtCe' => function($query){ + $query->field('id, lxdanwei_id, category_id, lxshijian') + ->with([ + 'ktCategory' => function($q){ + $q->field('id, title'); + }, + 'ktLxdanwei' => function($q){ + $q->field('id, jiancheng, title, jibie_id') + ->with(['dwJibie' => function($q){ + $q->field('id, title'); + }]); + } + ]); + }, ]) - ->field('id, title, fzdanwei_id, category_id, jddengji_id, bianhao') + ->field('id, title, fzdanwei_id, category_id, jddengji_id, bianhao, ketice_id') ->order('id') ->select(); @@ -164,7 +178,10 @@ class KetiInfo extends BaseModel $q->field('id, title'); }, 'ktLxdanwei' => function($q){ - $q->field('id, jiancheng, title'); + $q->field('id, jiancheng, title, jibie_id') + ->with([ + + ]); } ]); }, diff --git a/app/renshi/view/teacher/read.html b/app/renshi/view/teacher/read.html index c65ab1b8..cbe4e23c 100644 --- a/app/renshi/view/teacher/read.html +++ b/app/renshi/view/teacher/read.html @@ -218,19 +218,23 @@ } return str; }} - ,{field:'fzschool_id', title: '立项单位',sort:true, minWidth: 177,templet:function(d){ + ,{field:'ktLxdanwei', title: '立项单位',sort:true, minWidth: 177,templet:function(d){ var str=''; - if(d.fzSchool) + if(d.ktLxdanwei) { - str = d.fzSchool.jiancheng; + str = d.ktLxdanwei.jiancheng; } return str; }} ,{title: '级别', minWidth: 177,templet:function(d){ var str=''; - if(d.fzSchool) + console.log(d.ktLxdanwei); + if(d.ktLxdanwei) { - str = d.fzSchool.dwJibie.title; + if(d.ktLxdanwei.dwJibie){ + str = d.ktLxdanwei.dwJibie.title; + } + } return str; }}