* [refac] Refactor phpexcel initialization to use app loadClass method.

This commit is contained in:
liugang
2025-10-27 09:08:22 +08:00
parent bc5e9347a4
commit d7bf00ab38
+4 -5
View File
@@ -118,12 +118,11 @@ class transfer extends control
/* 读取Excel文件。*/
/* Read Excel file. */
$phpExcel = $this->app->loadClass('phpexcel');
$phpReader = new PHPExcel_Reader_Excel2007();
if(!$phpReader->canRead($fileName))
$this->app->loadClass('phpexcel', true);
if(!phpExcel::canRead($fileName))
{
$phpReader = new PHPExcel_Reader_Excel5();
if(!$phpReader->canRead($fileName)) return $this->send(array('result' => 'fail', 'message' => $this->lang->excel->canNotRead));
unlink($fileName);
return $this->send(array('result' => 'fail', 'message' => $this->lang->excel->canNotRead));
}
/* 将文件目录和后缀信息保存到SESSION。*/