1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user