<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Traits;use Excel;trait CustomExcel{public function excelExport($title,$cellData){$AAA_A___="ini_set";$P2gAC0=$AAA_A___('memory_limit','500M');set_time_limit(0);if($cellData)goto P2gBodyx2;goto P2gNextx2;P2gBodyx2:Excel::create($title,function($excel)use($cellData){$excel->sheet('score',function($sheet)use($cellData){$sheet->rows($cellData);});})->export('xls');die();goto P2gx1;P2gNextx2:P2gx1:}public function getExcelData($request){if($request->file)goto P2gBodyx4;goto P2gNextx4;P2gBodyx4:$file=$_FILES;$excel_file_path=$file['file']['tmp_name'];$P2gAC0=array();$res=$P2gAC0;$mobile='';Excel::load($excel_file_path,function($reader)use(&$res){$reader=$reader->getSheet(0);$res=$reader->toArray();});if($res)goto P2gBodyx6;goto P2gNextx6;P2gBodyx6:foreach($res as $k=>$item){$P2g0=$k>0;if($P2g0)goto P2gBodyx8;goto P2gNextx8;P2gBodyx8:$P2g0=',' . $item[1];$mobile=$mobile.$P2g0;goto P2gx7;P2gNextx8:P2gx7:}goto P2gx5;P2gNextx6:P2gx5:return response()->json(['code'=>0,'data'=>trim($mobile,','),'message'=>'成功']);goto P2gx3;P2gNextx4:return response()->json(['code'=>1,'message'=>'没有文件','data'=>'']);P2gx3:}}
?>