foreach ($sheetContent as $k => $v){
$arr[‘customerName‘] = $v[0];
$arr[‘sex‘] = $v[1];
$arr[‘typeId‘] = $v[2];
$arr[‘customerPhone‘] = $v[3];
$arr[‘sourceId‘] = $v[4];
$arr[‘birthday‘] = $v[5];
$arr[‘customerwechat‘] = $v[6];
$arr[‘customer_remarks‘] = $v[7];
$arr[‘createTime‘] = time();
$res[] = $arr;
};
$num = 100;//每次导入条数
$limit = ceil(count($res)/$num);
for($i=1;$i<=$limit;$i++){
$offset=($i-1)*$num;
$data=array_slice($res,$offset,$num);
$result=Db::name(‘customer‘)->insertAll($data);
};