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);
};

  

相关文章:

  • 2022-12-23
  • 2021-04-20
  • 2021-11-17
  • 2021-10-06
  • 2022-02-28
  • 2021-05-30
  • 2022-01-14
  • 2021-07-23
猜你喜欢
  • 2022-12-23
  • 2021-10-15
相关资源
相似解决方案