修改导出格式强制为字符串;

This commit is contained in:
2022-04-17 21:08:40 +08:00
parent eaf56e3652
commit 6ea41190c9

View File

@@ -2,6 +2,8 @@
namespace app\common\tools; namespace app\common\tools;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
class ExcelTools class ExcelTools
{ {
public static function exportModel($model, $where = [], $fields = [], $image_fields = [], $select_fields = []) public static function exportModel($model, $where = [], $fields = [], $image_fields = [], $select_fields = [])
@@ -70,7 +72,7 @@ class ExcelTools
$cel = $value; $cel = $value;
} }
$sheet->setCellValue($col_key . $write_line, $cel); $sheet->setCellValueExplicit($col_key . $write_line, $cel,DataType::TYPE_STRING);
$write_col++; $write_col++;
} }
} }