1
This commit is contained in:
@@ -5,6 +5,7 @@ use think\Db;
|
||||
use think\Env;
|
||||
use think\Cache;
|
||||
|
||||
|
||||
//use TCPDF;
|
||||
// +----------------------------------------------------------------------
|
||||
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
|
||||
@@ -23,6 +24,24 @@ function authcode($str)
|
||||
return md5($key . $str1);
|
||||
}
|
||||
|
||||
|
||||
function readExcel($file){
|
||||
// 读取Excel文件
|
||||
$objPHPExcel = PHPExcel_IOFactory::load($file);
|
||||
|
||||
// 获取表格中的数据
|
||||
$sheet = $objPHPExcel->getSheet(0); // 获取第一个工作表
|
||||
$highestRow = $sheet->getHighestRow(); // 取得总行数
|
||||
$highestColumn = $sheet->getHighestColumn(); // 取得总列数
|
||||
|
||||
$dataset = [];
|
||||
for ($row = 1; $row <= $highestRow; $row++) {
|
||||
$rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE);
|
||||
array_push($dataset, $rowData[0]);
|
||||
}
|
||||
return $dataset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @function sendEmail
|
||||
* @intro 发送邮件(带附件)
|
||||
|
||||
Reference in New Issue
Block a user