...
|
...
|
@@ -354,6 +354,10 @@ class OrderController extends AdminBaseController |
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('AN')->setWidth(20);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('AO')->setWidth(20);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('AP')->setWidth(20);
|
|
|
// 设置水平居中
|
|
|
$objPHPExcel->getDefaultStyle()->getAlignment()->setHorizontal(\PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
|
|
|
// 设置垂直居中
|
|
|
$objPHPExcel->getDefaultStyle()->getAlignment()->setVertical(\PHPExcel_Style_Alignment::VERTICAL_CENTER);
|
|
|
//Add some data
|
|
|
$objPHPExcel->setActiveSheetIndex(0)
|
|
|
->setCellValue('A1', 'ID')
|
...
|
...
|
@@ -434,7 +438,8 @@ class OrderController extends AdminBaseController |
|
|
->setCellValueExplicit($vs['cell'] . $i, $vs['user_choose'],\PHPExcel_Cell_DataType::TYPE_STRING);
|
|
|
} elseif($vs['type'] == 8) {
|
|
|
// 导出图片格式,高度自适应
|
|
|
if(!empty($vs['user_choose']) && file_exists('./upload/'.$vs['user_choose'])) {
|
|
|
$filePath = './upload/'.$vs['user_choose'];
|
|
|
if(!empty($vs['user_choose']) && file_exists($filePath)) {
|
|
|
$image = \think\Image::open('./upload/'.$vs['user_choose']);
|
|
|
// 返回图片的宽度
|
|
|
$width = $image->width();
|
...
|
...
|
@@ -445,7 +450,7 @@ class OrderController extends AdminBaseController |
|
|
$objPHPExcel->getActiveSheet()->getRowDimension($i)->setRowHeight($default);
|
|
|
// 图片生成
|
|
|
$objDrawing[$i] = new \PHPExcel_Worksheet_Drawing();
|
|
|
$objDrawing[$i]->setPath('./upload/'.$vs['user_choose']);
|
|
|
$objDrawing[$i]->setPath($filePath);
|
|
|
// 设置宽度
|
|
|
$objDrawing[$i]->setWidth(100); //照片宽度
|
|
|
/*设置图片要插入的单元格*/
|
...
|
...
|
|