|
@@ -31,9 +31,11 @@ class ImportService extends Service
|
|
|
|
|
|
const file_one = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
const file_one = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
const file_two = 'application/zip';
|
|
const file_two = 'application/zip';
|
|
|
|
+ const file_three = 'application/octet-stream';
|
|
const file_array = [
|
|
const file_array = [
|
|
self::file_one,
|
|
self::file_one,
|
|
self::file_two,
|
|
self::file_two,
|
|
|
|
+ self::file_three,
|
|
];
|
|
];
|
|
|
|
|
|
//文件类型
|
|
//文件类型
|
|
@@ -214,7 +216,13 @@ class ImportService extends Service
|
|
unlink($tempFile);
|
|
unlink($tempFile);
|
|
|
|
|
|
return [true, ["content" => $allFilesData, 'type' => 'zip']];
|
|
return [true, ["content" => $allFilesData, 'type' => 'zip']];
|
|
- } else {
|
|
|
|
|
|
+ } elseif ($mimeType === self::file_three){
|
|
|
|
+ // 处理单个XLSX文件
|
|
|
|
+ list($status,$result) = $this->processXlsxFile($tempFile);
|
|
|
|
+ if (! $status) return [false, $result];
|
|
|
|
+
|
|
|
|
+ return [true, ['content' => [$result], 'type' => 'xlsx']];
|
|
|
|
+ }else {
|
|
// 删除临时文件
|
|
// 删除临时文件
|
|
unlink($tempFile);
|
|
unlink($tempFile);
|
|
return [false, '不支持的文件类型'];
|
|
return [false, '不支持的文件类型'];
|