修改学生自定义考号为学号
This commit is contained in:
1 parent
073b194e0b
commit
04fa47f9e3
9 files changed
+29
-24
No files matched your search
@@ -127,13 +127,13 @@ class Kaohao extends BaseModel
|
||||
|
||||
|
||||
// 获取学生考号
|
||||
public function getKaohaoAttr()
|
||||
public function getXuehaoAttr()
|
||||
{
|
||||
$kaohao = "";
|
||||
if (isset($this->cjStudent->kaohao)) {
|
||||
$kaohao = $this->cjStudent->kaohao;
|
||||
$xuehao = "";
|
||||
if (isset($this->cjStudent->xuehao)) {
|
||||
$xuehao = $this->cjStudent->xuehao;
|
||||
}
|
||||
return $kaohao;
|
||||
return $xuehao;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -116,10 +116,10 @@ class SearchMore extends BaseModel
|
||||
$query->field('id, jiancheng');
|
||||
}
|
||||
,'cjStudent' => function($query){
|
||||
$query->field('id, xingming, sex, shengri, kaohao');
|
||||
$query->field('id, xingming, sex, shengri, xuehao');
|
||||
}
|
||||
])
|
||||
->append(['banjiTitle', 'banTitle', 'kaohao'])
|
||||
->append(['banjiTitle', 'banTitle', 'xuehao'])
|
||||
->select();
|
||||
return $data;
|
||||
}
|
||||
@@ -234,6 +234,10 @@ class SearchMore extends BaseModel
|
||||
'kaoshi_id' => '0'
|
||||
,'banji_id' => array()
|
||||
,'subject_id' => array()
|
||||
,'field' => 'student_xingming'
|
||||
,'order' => 'desc'
|
||||
,'page'
|
||||
,'limit'
|
||||
);
|
||||
// 用新值替换初始值
|
||||
$src = array_cover($srcfrom, $src);
|
||||
@@ -254,7 +258,7 @@ class SearchMore extends BaseModel
|
||||
$data[$key]['student_xingming'] = $value->cjStudent->xingming;
|
||||
$data[$key]['sex'] = $value->cjStudent->sex;
|
||||
$data[$key]['shengri'] = $value->cjStudent->shengri;
|
||||
$data[$key]['kaohao'] = $value->kaohao;
|
||||
$data[$key]['xuehao'] = $value->xuehao;
|
||||
|
||||
foreach ($sbjList as $sbj_k => $sbj_v) {
|
||||
$data[$key][$sbj_v->lieming] = '';
|
||||
@@ -310,7 +314,7 @@ class SearchMore extends BaseModel
|
||||
->order(['banji_id', 'id'])
|
||||
->with([
|
||||
'cjStudent' => function($q){
|
||||
$q->field('id, xingming, sex, shoupin, kaohao');
|
||||
$q->field('id, xingming, sex, shoupin, xuehao');
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ class Index extends AdminBase
|
||||
$sheet->setCellValue('A3', '序号'); # 表头
|
||||
$sheet->setCellValue('B3', '编号');
|
||||
$sheet->setCellValue('C3', '班级');
|
||||
$sheet->setCellValue('D3', '考号');
|
||||
$sheet->setCellValue('D3', '学号');
|
||||
$sheet->setCellValue('E3', '姓名');
|
||||
// 获取列数并合并和一行
|
||||
$col = $lieming[count($ksSubject) + 4];
|
||||
@@ -557,7 +557,7 @@ class Index extends AdminBase
|
||||
}
|
||||
$sheet->setCellValue('B' . $i, $md5::encrypt((string)$kh['id'], 'dlbz'));
|
||||
$sheet->setCellValue('C' . $i, $bj['banjiTitle']);
|
||||
$sheet->setCellValue('D' . $i, $kh['cjStudent']['kaohao']);
|
||||
$sheet->setCellValue('D' . $i, $kh['cjStudent']['xuehao']);
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ class Index extends AdminBase
|
||||
->only([
|
||||
'page'
|
||||
,'limit'
|
||||
,'field' => 'id'
|
||||
,'field' => 'student_xingming'
|
||||
,'order' => 'asc'
|
||||
,'kaoshi_id'
|
||||
,'banji_id' => array()
|
||||
@@ -802,6 +802,7 @@ class Index extends AdminBase
|
||||
// 实例化并查询成绩
|
||||
$cj = new \app\kaohao\model\SearchMore;
|
||||
$data = $cj->srcOnlineEdit($src);
|
||||
// halt($data);
|
||||
$data = reSetArray($data, $src);
|
||||
|
||||
return json($data);
|
||||
|
||||
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user