Commit da09810a authored by 王源's avatar 王源 🎧

Merge branch 'develop' into test

parents f6071107 1c23d31d
......@@ -52,7 +52,7 @@ class UploadManager
{
$excelOptions = [
'path' => 'excel',
'mime' => ['xlsx', 'xls']
'mime' => ['xlsx', 'xls', 'csv']
];
$options = array_merge($excelOptions, $options);
return self::uploadFile($excel, $options);
......@@ -69,7 +69,7 @@ class UploadManager
{
$excelOptions = [
'path' => 'excel',
'mime' => ['xlsx', 'xls']
'mime' => ['xlsx', 'xls', 'csv']
];
$options = array_merge($excelOptions, $options);
return self::uploadFile($excel, $options, true);
......@@ -150,9 +150,9 @@ class UploadManager
$file->moveTo($savePath);
if ($file->isMoved()) {
if ($realPath) {
return $savePath.'?'.$name;
return $savePath . '?' . $name;
} else {
return str_replace($documentRoot, '', $savePath.'?'.$name);
return str_replace($documentRoot, '', $savePath . '?' . $name);
}
} else {
throw new HttpResponseException('文件保存失败');
......
......@@ -216,7 +216,7 @@ class Exporter
* @return Exporter
* @throws PhpSpreadsheetException
*/
public function append(array $data, $keys = [])
public function append(array $data, $keys = [], $noStyle = false)
{
// 一维数组转二维
foreach ($data as $v) {
......@@ -233,8 +233,10 @@ class Exporter
}
$this->sheet->fromArray($data, null, $this->beginColumnChar . $this->beginRowIndex);
//美化样式
if (!$noStyle) {
// 美化样式
$this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1));
}
$this->beginRowIndex += count($data);
return $this;
}
......@@ -386,7 +388,7 @@ class Exporter
$date = date('YmdHis');
$fileReadPath = $filePath . $filename . '-' . $date . "." . strtolower($this->fileType);
$objWriter->save($fileReadPath);
return config('server.settings.document_root') . "/export/" . $filename . '-' .$date . "." .
return config('server.settings.document_root') . "/export/" . $filename . '-' . $date . "." .
strtolower($this->fileType);
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment