|
@@ -82,6 +82,7 @@ class Study extends Backend |
|
@@ -82,6 +82,7 @@ class Study extends Backend |
82
|
|
82
|
|
83
|
$excel = new \PHPExcel();
|
83
|
$excel = new \PHPExcel();
|
84
|
try {
|
84
|
try {
|
|
|
85
|
+ $excel->getProperties()->setTitle("积分表");
|
85
|
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(10);
|
86
|
$excel->getActiveSheet()->getColumnDimension('A')->setWidth(10);
|
86
|
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(10);
|
87
|
$excel->getActiveSheet()->getColumnDimension('B')->setWidth(10);
|
87
|
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(10);
|
88
|
$excel->getActiveSheet()->getColumnDimension('C')->setWidth(10);
|
|
@@ -108,9 +109,9 @@ class Study extends Backend |
|
@@ -108,9 +109,9 @@ class Study extends Backend |
108
|
->setCellValue('G1', '学号')
|
109
|
->setCellValue('G1', '学号')
|
109
|
->setCellValue('H1', '总积分');
|
110
|
->setCellValue('H1', '总积分');
|
110
|
if ($ids == 'all' || empty($ids)) { //判断当前数据为全部或者选中的
|
111
|
if ($ids == 'all' || empty($ids)) { //判断当前数据为全部或者选中的
|
111
|
- $list = $this->model->with('school')->select();
|
112
|
+ $list = $this->model->with('school,grade')->select();
|
112
|
} else {
|
113
|
} else {
|
113
|
- $list = $this->model->with('school')->select($ids);
|
114
|
+ $list = $this->model->with('school,grade')->select($ids);
|
114
|
}
|
115
|
}
|
115
|
|
116
|
|
116
|
foreach ($list as $k => $val) {
|
117
|
foreach ($list as $k => $val) {
|
|
@@ -121,7 +122,7 @@ class Study extends Backend |
|
@@ -121,7 +122,7 @@ class Study extends Backend |
121
|
->setCellValue('A' . $k, $val['id'])
|
122
|
->setCellValue('A' . $k, $val['id'])
|
122
|
->setCellValue('B' . $k, $val['name'])
|
123
|
->setCellValue('B' . $k, $val['name'])
|
123
|
->setCellValue('C' . $k, $val['gender'] ? '男' : '女')
|
124
|
->setCellValue('C' . $k, $val['gender'] ? '男' : '女')
|
124
|
- ->setCellValue('D' . $k, $val['grade'])
|
125
|
+ ->setCellValue('D' . $k, $val['grade']['name'])
|
125
|
->setCellValue('E' . $k, $val['school']['title'])
|
126
|
->setCellValue('E' . $k, $val['school']['title'])
|
126
|
->setCellValue('F' . $k, $val['unique'])
|
127
|
->setCellValue('F' . $k, $val['unique'])
|
127
|
->setCellValue('G' . $k, $val['sno'])
|
128
|
->setCellValue('G' . $k, $val['sno'])
|