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