This commit is contained in:
wangjinlei
2023-01-29 17:41:11 +08:00
parent dbfc3c6452
commit b1b4704964
7 changed files with 1497 additions and 882 deletions

View File

@@ -159,9 +159,18 @@ class Auto extends Controller {
public function pppp(){
$extension_obj = Db::name('exten');
$file = "D://11.xlsx";
$journal_abbr_obj = Db::name('journal_abbr');
$file = "D://bbbb.xlsx";
$res = $this->readExcel($file);
$f = [];
foreach($res as $v){
$cache['full_name'] = $v['full'];
$cache['little_name'] = $v['aa'];
$f[] = $cache;
// $company_top_obj->insert($cache);
}
$journal_abbr_obj->insertAll($f);
// // dump($res);
// $extension_obj->insertAll($res);
}
@@ -180,15 +189,19 @@ class Auto extends Controller {
$highestRow = $sheet->getHighestRow();
$frag = [];
$frag1 = [];
for ($i = 2; $i <= $highestRow; $i++) {
$aa = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
for ($i = 0; $i <= $highestRow; $i++) {
$full = $objPHPExcel->getActiveSheet()->getCell("A" . $i)->getValue();
$aa = $objPHPExcel->getActiveSheet()->getCell("B" . $i)->getValue();
if($aa==''){
continue;
}
if(!in_array($aa,$frag1)){
$frag1[] = $aa;
$frag[] = ['email'=>$aa];
}
// if(!in_array($aa,$frag1)){
// $frag1[] = $aa;
// $frag[] = ['email'=>$aa];
// }
$ch['full'] = $full;
$ch['aa'] = $aa;
$frag[] = $ch;
}
return $frag;
}