This commit is contained in:
wangjinlei
2022-12-30 11:41:29 +08:00
parent a8f2c71bc0
commit dbfc3c6452
5 changed files with 177 additions and 5 deletions

View File

@@ -145,6 +145,54 @@ class Auto extends Controller {
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
}
public function qqqq(){
$extension_obj = Db::name('exten');
$data = $this->request->post();
$num = $data['num'];
$limit_start = ($num - 1) * 1000;
$list = $extension_obj->limit($limit_start,1000)->select();
$re['list'] = $list;
return jsonSuccess($re);
}
public function pppp(){
$extension_obj = Db::name('exten');
$file = "D://11.xlsx";
$res = $this->readExcel($file);
// $extension_obj->insertAll($res);
}
private function readExcel($path) {
$extension = substr($path, strrpos($path, '.') + 1);
vendor("PHPExcel.PHPExcel");
if ($extension == 'xlsx') {
$objReader = new \PHPExcel_Reader_Excel2007();
$objPHPExcel = $objReader->load($path);
} else if ($extension == 'xls') {
$objReader = new \PHPExcel_Reader_Excel5();
$objPHPExcel = $objReader->load($path);
}
$sheet = $objPHPExcel->getSheet(0);
$highestRow = $sheet->getHighestRow();
$frag = [];
$frag1 = [];
for ($i = 2; $i <= $highestRow; $i++) {
$aa = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
if($aa==''){
continue;
}
if(!in_array($aa,$frag1)){
$frag1[] = $aa;
$frag[] = ['email'=>$aa];
}
}
return $frag;
}
private function creatLoginUrlForreviewer($user, $article_id) {
$code = md5(time() . rand(1000, 9999) . 'thinkphp');
$insert['user_id'] = $user['user_id'];
@@ -166,9 +214,6 @@ class Auto extends Controller {
}
public function pushEmailForAuthor1(){
}
/**
* 推送邮件提醒作者修回稿件