修改部分表格显示,修复已知错误
This commit is contained in:
1 parent
83e0f4b1dc
commit
0e6c551650
7 files changed
+99
-23
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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 }
|
||||
]
|
||||
|
||||
Loaded 3 of 7 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user