导入XLXS或XLS时如何防止maatwebsite / excel更改数据结构

问题描述

我正在将xlxs文件导入到集合中。但是,单元格中的值是变化的,例如

3614226905352更改为3.614226905369E12

2020.0

500500.0

$90.0090.0

 ///Controller

 $import = new ImportFilterService();
 Excel::import($import,$file->getRealPath());
class ImportFilterService implements ToCollection
{
 public function collection(Collection $rows)
 {
  foreach ($rows as $key => $item) {
   dd($item);

  }
 }
}

我尝试实施WithCustomValueBinder

public function bindValue(Cell $cell,$value){

}

但是,在调用bindValue方法时,$ value已经被更改。

有什么想法如何确保xlxs文件或xls文件保留原始单元格值?

P.S。使用Rap2hpoutre FastExcel时我没有这个问题。但是,该库不适用于xls

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...