/* 商户池导入*/ public function sellerpoolimport(){ import('Component/PHPExcel',APP_PATH,'.php'); // 引入Excel处理类 $PHPReader = new \PHPExcel_Reader_Excel2007(); $filePath = $_FILES['url']['tmp_name']; //获取上传文件临时目录 //判断文件类型 if (!$PHPReader->canRead($filePath)) { $PHPReader = new \PHPExcel_Reader_Excel5(); if (!$PHPReader->canRead($filePath)) { $this->error('请选择Excel文件',U('Seller/sellerpoolindex'),3); } } $PHPExcel = $PHPReader->load($_FILES['url']['tmp_name']); /**读取excel文件中的第一个工作表*/ //并且转成数组 $currentSheetArr = $PHPExcel->getSheet(0)->toArray(); $res = D('Seller')->sellerpoolimport(I('post.channeltype'),I('post.companycode'),$currentSheetArr); if(!is_array($res)) $this->error($res,U('Seller/sellerpoolindex'),6); $this->success('导入成功',U('Seller/sellerpoolindex'),3); }
php 获取excel表数据,php获取excel表数据
最新推荐文章于 2022-04-08 14:37:53 发布