diff --git a/app/kaohao/model/Kaohao.php b/app/kaohao/model/Kaohao.php index 0c8513d8..ffd12a6d 100755 --- a/app/kaohao/model/Kaohao.php +++ b/app/kaohao/model/Kaohao.php @@ -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; } } diff --git a/app/kaohao/model/SearchMore.php b/app/kaohao/model/SearchMore.php index 1556acfb..c34b9025 100755 --- a/app/kaohao/model/SearchMore.php +++ b/app/kaohao/model/SearchMore.php @@ -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'); } ]); } diff --git a/app/luru/controller/Index.php b/app/luru/controller/Index.php index 5c7bfebb..1926f1aa 100755 --- a/app/luru/controller/Index.php +++ b/app/luru/controller/Index.php @@ -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); diff --git a/app/luru/view/index/onlineedit.html b/app/luru/view/index/onlineedit.html index 32b52fcc..396444d9 100644 --- a/app/luru/view/index/onlineedit.html +++ b/app/luru/view/index/onlineedit.html @@ -53,7 +53,7 @@ layui.use(['table', 'form'], function() { { type: 'checkbox', fixed: 'left' }, { type: 'numbers', fixed: 'left', title: '序号' }, { field: 'school_jiancheng', title: '学校', width: 80, sort: true }, - { field: "kaohao", title: '考号', width: 100, sort: true }, + { field: "xuehao", title: '学号', width: 100, sort: true }, { field: "ban_title", title: '班级', width: 100, sort: true }, { field: "student_xingming", title: '学生姓名', sort: true, width: 100 }, { field: "sex", title: '性别', sort: true, width: 80 }, diff --git a/app/student/controller/Index.php b/app/student/controller/Index.php index 60f2e29f..094264aa 100755 --- a/app/student/controller/Index.php +++ b/app/student/controller/Index.php @@ -180,7 +180,7 @@ class Index extends AdminBase ,'kaoshi' ,'quanpin' ,'shoupin' - ,'kaohao' + ,'xuehao' ], 'POST'); // 权限判断 @@ -274,7 +274,7 @@ class Index extends AdminBase ,'kaoshi' ,'quanpin' ,'shoupin' - ,'kaohao' + ,'xuehao' ], 'PUT'); $list['id'] = $id; diff --git a/app/student/model/Student.php b/app/student/model/Student.php index 59147a74..87723b8c 100755 --- a/app/student/model/Student.php +++ b/app/student/model/Student.php @@ -138,7 +138,7 @@ class Student extends BaseModel $query->field('id, ruxuenian, paixu, alias')->append(['banjiTitle']); } ]) - ->field('id, xingming, sex, shengri, banji_id, kaoshi, kaohao, status, update_time') + ->field('id, xingming, sex, shengri, banji_id, kaoshi, xuehao, status, update_time') ->append(['age']) ->select(); diff --git a/app/student/validate/Student.php b/app/student/validate/Student.php index da258fd3..f9d677cc 100755 --- a/app/student/validate/Student.php +++ b/app/student/validate/Student.php @@ -22,7 +22,7 @@ class Student extends Validate 'banji_id|班级' => 'require|number', 'kaoshi|是否参加考试' => 'require|number', 'quanpin|姓名全拼' => 'require', - 'kaohao|考号' => 'alphaNum|max:25' + 'xuehao|考号' => 'alphaNum|max:25' ]; /** @@ -41,7 +41,7 @@ class Student extends Validate ,'ruxuenian' ,'banji_id' ,'kaoshi' - ,'kaohao' + ,'xuehao' ], 'edit' => [ 'id' @@ -49,11 +49,11 @@ class Student extends Validate ,'sex' ,'shenfenzhenghao' ,'kaoshi' - ,'kaohao' + ,'xuehao' ], 'onekaohao' => [ 'id' - ,'kaohao' + ,'xuehao' ], ]; } diff --git a/app/student/view/index/index.html b/app/student/view/index/index.html index 4c3a14b0..bef55546 100755 --- a/app/student/view/index/index.html +++ b/app/student/view/index/index.html @@ -118,7 +118,7 @@ layui.use(['table', 'mytable', 'createInput', 'form'], function() { return d.age; } }, - { field: 'kaohao', title: '考号', minWidth:80, sort: true, edit: 'text'}, + { field: 'xuehao', title: '学号', minWidth:80, sort: true, edit: 'text'}, { field: 'status', title: '是否参加考试', templet: '#kaoshi', minWidth:80, sort: true }, { field: 'status', title: '状态', templet: '#status', minWidth:80, sort: true }, { field: 'id', title: '操作', toolbar: '#barDemo', minWidth: 180 } diff --git a/database/migrations/20210525115813_add_student_kaohao.php b/database/migrations/20210525115813_add_student_kaohao.php index 7ccda61b..b22ba066 100644 --- a/database/migrations/20210525115813_add_student_kaohao.php +++ b/database/migrations/20210525115813_add_student_kaohao.php @@ -32,7 +32,7 @@ class AddStudentKaohao extends Migrator $column = $table->hasColumn('kaohao'); if (!$column) { $table - ->addColumn('kaohao','string',['limit'=>25,'null'=>true,'comment'=>'自定义考号']) + ->addColumn('xuehao','string',['limit'=>25,'null'=>true,'comment'=>'自定义学号']) ->update(); } } @@ -42,10 +42,10 @@ class AddStudentKaohao extends Migrator public function down() { $table = $this->table('student'); - $column = $table->hasColumn('kaohao'); + $column = $table->hasColumn('xuehao'); if ($column) { $table - ->removeColumn('kaohao'); + ->removeColumn('xuehao'); } } }