From 0e6c551650b49288c8507eee561e31d847ba4fe7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Jun 2021 14:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=98=BE=E7=A4=BA=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=B7=B2?= =?UTF-8?q?=E7=9F=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/kaohao/model/SearchMore.php | 17 +++++++++++++--- app/student/model/Student.php | 18 +++++++++++++++-- app/student/view/index/by_list.html | 29 ++++++++++++++++++++++------ app/student/view/index/del_list.html | 29 ++++++++++++++++++++++------ app/student/view/index/index.html | 17 ++++++++++++++++ app/teach/view/banji/index.html | 10 +++++----- app/teach/view/subject/index.html | 2 +- 7 files changed, 99 insertions(+), 23 deletions(-) diff --git a/app/kaohao/model/SearchMore.php b/app/kaohao/model/SearchMore.php index c34b9025..5540757c 100755 --- a/app/kaohao/model/SearchMore.php +++ b/app/kaohao/model/SearchMore.php @@ -250,14 +250,25 @@ class SearchMore extends BaseModel $sbjList = $sbj->where('id', 'in', $src['subject_id']) ->field('id, title, jiancheng, lieming') ->select(); + $stu = new \app\student\model\Student; $data = array(); foreach ($khlist as $key => $value) { $data[$key]['id'] = $value['id']; $data[$key]['school_jiancheng'] = $value->cjSchool->jiancheng; $data[$key]['ban_title'] = $value->banTitle; - $data[$key]['student_xingming'] = $value->cjStudent->xingming; - $data[$key]['sex'] = $value->cjStudent->sex; - $data[$key]['shengri'] = $value->cjStudent->shengri; + if (!$value->cjStudent) { + $stuInfo = $stu::withTrashed() + ->where('id', $value->student_id) + ->field('id, xingming, sex, shengri') + ->find(); + $data[$key]['student_xingming'] = $stuInfo->xingming; + $data[$key]['sex'] = $stuInfo->sex; + $data[$key]['shengri'] = $stuInfo->shengri; + } else { + $data[$key]['student_xingming'] = $value->cjStudent->xingming; + $data[$key]['sex'] = $value->cjStudent->sex; + $data[$key]['shengri'] = $value->cjStudent->shengri; + } $data[$key]['xuehao'] = $value->xuehao; foreach ($sbjList as $sbj_k => $sbj_v) { diff --git a/app/student/model/Student.php b/app/student/model/Student.php index 1bd16b63..da6c006f 100755 --- a/app/student/model/Student.php +++ b/app/student/model/Student.php @@ -135,7 +135,14 @@ class Student extends BaseModel }) ->with([ 'stuBanji'=>function($query){ - $query->field('id, ruxuenian, paixu, alias')->append(['banjiTitle']); + $query + ->field('id, ruxuenian, paixu, alias, school_id') + ->with([ + 'glSchool' => function($query){ + $query->field('id, title, jiancheng'); + }, + ]) + ->append(['banjiTitle']); } ]) ->field('id, xingming, sex, shengri, banji_id, kaoshi, xuehao, status, update_time') @@ -200,7 +207,14 @@ class Student extends BaseModel }) ->with([ 'stuBanji'=>function($query){ - $query->field('id, ruxuenian, paixu, alias')->append(['banjiTitle']); + $query + ->field('id, ruxuenian, paixu, alias, school_id') + ->with([ + 'glSchool' => function($query){ + $query->field('id, title, jiancheng'); + }, + ]) + ->append(['banjiTitle']); } ]) ->field('id, xingming, sex, shengri, banji_id, kaoshi, status, update_time') diff --git a/app/student/view/index/by_list.html b/app/student/view/index/by_list.html index 85d1456e..ffb11dbf 100755 --- a/app/student/view/index/by_list.html +++ b/app/student/view/index/by_list.html @@ -75,14 +75,21 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { options.cols = [ [ //表头 { type: 'checkbox', fixed: 'left' }, - { field: 'xingming', title: '姓名', sort: true }, - { field: 'sex', title: '性别', sort: true }, { - field: "shengri", - title: '周岁', - sort: true, + title: '学校', + fixed: 'left', + width:70, templet: function(d) { - return d.age; + var str = ''; + if (d.stuBanji) { + if (d.stuBanji.glSchool) { + if (d.stuBanji.glSchool.jiancheng) { + d.stuBanji.glSchool.jiancheng; + } + } + str = d.stuBanji.glSchool.jiancheng; + } + return str; } }, { @@ -97,6 +104,16 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { return str; } }, + { field: 'xingming', title: '姓名', sort: true }, + { field: 'sex', title: '性别', sort: true }, + { + field: "shengri", + title: '周岁', + sort: true, + templet: function(d) { + return d.age; + } + }, { field: 'status', title: '状态', templet: '#status', sort: true }, { field: 'id', title: '操作', toolbar: '#barDemo', minWidth: 140 } ] diff --git a/app/student/view/index/del_list.html b/app/student/view/index/del_list.html index ec74c6e6..6c628a24 100755 --- a/app/student/view/index/del_list.html +++ b/app/student/view/index/del_list.html @@ -74,14 +74,21 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { options.cols = [ [ //表头 { type: 'checkbox', fixed: 'left' }, - { field: 'xingming', title: '姓名', sort: true }, - { field: 'sex', title: '性别', sort: true }, { - field: "shengri", - title: '周岁', - sort: true, + title: '学校', + fixed: 'left', + width:70, templet: function(d) { - return d.age; + var str = ''; + if (d.stuBanji) { + if (d.stuBanji.glSchool) { + if (d.stuBanji.glSchool.jiancheng) { + d.stuBanji.glSchool.jiancheng; + } + } + str = d.stuBanji.glSchool.jiancheng; + } + return str; } }, { @@ -96,6 +103,16 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { return str; } }, + { field: 'xingming', title: '姓名', sort: true }, + { field: 'sex', title: '性别', sort: true }, + { + field: "shengri", + title: '周岁', + sort: true, + templet: function(d) { + return d.age; + } + }, { field: 'status', title: '状态', templet: '#status', sort: true }, { field: 'id', title: '操作', toolbar: '#barDemo', minWidth: 140 } ] diff --git a/app/student/view/index/index.html b/app/student/view/index/index.html index bef55546..2d29913b 100755 --- a/app/student/view/index/index.html +++ b/app/student/view/index/index.html @@ -94,6 +94,23 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { options.cols = [ [ //表头 { type: 'checkbox', fixed: 'left' }, + { + title: '学校', + fixed: 'left', + width:70, + templet: function(d) { + var str = ''; + if (d.stuBanji) { + if (d.stuBanji.glSchool) { + if (d.stuBanji.glSchool.jiancheng) { + d.stuBanji.glSchool.jiancheng; + } + } + str = d.stuBanji.glSchool.jiancheng; + } + return str; + } + }, { field: 'banji', title: '班级', diff --git a/app/teach/view/banji/index.html b/app/teach/view/banji/index.html index 2d668269..541f9b92 100755 --- a/app/teach/view/banji/index.html +++ b/app/teach/view/banji/index.html @@ -78,14 +78,14 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { options.cols = [ [ //表头 { type: 'checkbox', fixed: 'left' }, - { field: 'id', title: 'ID', minWidth: 100, sort: true, fixed:'left' }, + { field: 'id', title: 'ID', minWidth: 50, sort: true, fixed:'left' }, {field: 'banjiTitle',title: '班级名称',minWidth: 100, fixed:'left'}, { field: 'alias', title: '别名', minWidth: 60, edit: 'text' }, { field: 'banzhuren', - title: '现任班主任', + title: '班主任', sort: true, - minWidth: 60, + minWidth: 90, templet: function(d) { var str = ''; if (d.bzr) { @@ -107,9 +107,9 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { return str; } }, - { field: "ruxuenian", title: '入学年', sort: true }, + { field: "ruxuenian", title: '入学年', sort: true, minWidth:90 }, { field: 'paixu', title: '排序', sort: true }, - { field: "gl_student_count", title: '学生数', sort: true }, + { field: "gl_student_count", title: '学生数', sort: true, minWidth:90 }, { field: 'status', title: '状态', templet: '#status', sort: true }, { field: 'id', title: '操作', toolbar: '#barDemo', minWidth: 200} ] diff --git a/app/teach/view/subject/index.html b/app/teach/view/subject/index.html index 4fa60aab..8ccd0e2a 100755 --- a/app/teach/view/subject/index.html +++ b/app/teach/view/subject/index.html @@ -82,7 +82,7 @@ layui.use(['table', 'mytable', 'form'], function() { } }, { field: 'lieming', title: '列标识', sort: true }, - { field: 'kaoshi', title: '是否参加考试', templet: '#kaoshi', sort: true }, + { field: 'kaoshi', title: '考试', templet: '#kaoshi', sort: true }, { field: 'paixu', title: '排序', sort: true }, { field: 'status', title: '状态', templet: '#status', sort: true }, { field: 'id', title: '操作', toolbar: '#barDemo', minWidth: 140 }