diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 8fee1511..b98a6fd8 100755 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -324,6 +324,7 @@ class Index extends AdminBase $sheet->setCellValue($colname [$i]. '3', '平均分'); $i ++; $sheet->setCellValue($colname[$i] . '3', '总分'); + $left_i = $i; $sheet->mergeCells('A1:' . $colname[$i] . '1'); # 合并标题行 $sheet->mergeCells('A2:' . $colname[$i] . '2'); # 合并时间行 $col_null = 3; # 统计结果与成绩列表空两列 @@ -340,6 +341,7 @@ class Index extends AdminBase $sheet->setCellValue($colname[$i] . $row, $value['title']); $i ++; } + $right_i = $i; // 循环写出成绩及个人信息 $i = 0; @@ -396,14 +398,14 @@ class Index extends AdminBase ], ], ]; - $sheet->getStyle('A3:'.$colname[$i] . ($row_temp - 1))->applyFromArray($styleArrayBK); + $sheet->getStyle('A3:'.$colname[$left_i] . ($row_temp - 1))->applyFromArray($styleArrayBK); $tj = new \app\chengji\model\Tongji; $temp = $tj->tongjiSubject($chengjiinfo, $subject_id); // 左侧开始列 - $i = $i + $col_null ; + $i = $left_i + $col_null ; $col_r = $i; // 循环写出统计结果 diff --git a/app/chengji/controller/Njtongji.php b/app/chengji/controller/Njtongji.php index e622f760..2f2b80e8 100755 --- a/app/chengji/controller/Njtongji.php +++ b/app/chengji/controller/Njtongji.php @@ -96,7 +96,8 @@ class Njtongji extends AdminBase // 获取年级与学科 $ksset = new \app\kaoshi\model\KaoshiSet; - $list['set']['nianji'] = $ksset->srcGrade($kaoshi_id); + $src['kaoshi_id'] = $kaoshi_id; + $list['set']['nianji'] = $ksset->srcGrade($src); // 模板赋值 $this->view->assign('list', $list); @@ -144,6 +145,7 @@ class Njtongji extends AdminBase $sheet = $spreadsheet->getActiveSheet(); $thistime = date("Y-m-d h:i:sa"); + // 设置文档属性 $spreadsheet->getProperties() ->setCreator("码蚁成绩管理系统") //作者 @@ -230,7 +232,8 @@ class Njtongji extends AdminBase $sheet->getStyle('A1')->getFont()->setBold(true)->setName('宋体')->setSize(20); # 修改标题字号 $sheet->getDefaultRowDimension()->setRowHeight(35); # 设置行高 - $sheet->getRowDimension('3:4')->setRowHeight(25); + $sheet->getRowDimension(3)->setRowHeight(25);; + $sheet->getRowDimension(4)->setRowHeight(25);; $sheet->getDefaultColumnDimension()->setWidth(8.3); # 设置列宽 $sheet->getColumnDimension('A')->setWidth(5); $sheet->getColumnDimension('B')->setWidth(10.5); diff --git a/database/migrations/20211107125646_chengji_biaozhunfen.php b/database/migrations/20211107125646_chengji_biaozhunfen.php new file mode 100644 index 00000000..eaa57e2c --- /dev/null +++ b/database/migrations/20211107125646_chengji_biaozhunfen.php @@ -0,0 +1,51 @@ +table('chengji'); + $column = $table->hasColumn('biaozhunfen'); + if (!$column) { + $table + ->addColumn('biaozhunfen','decimal',['precision'=>6,'scale'=>2,'default'=>Null,'null'=>false,'comment'=>'标准分']) + ->update(); + } + } + + + //版本退回 + public function down() + { + $table = $this->table('chengji'); + $column = $table->hasColumn('biaozhunfen'); + if ($column) { + $table + ->removeColumn('biaozhunfen'); + } + } +}