合并单元格导出
程序员文章站
2022-06-14 08:09:42
...
$num_arr = array_column($result,'order_num');
$arr = array_count_values($num_arr);
foreach ($arr as $kk=>$vv) {
if($vv>1){
$keys = array_keys($num_arr,$kk);
$end = $keys[count($keys)-1]+2;
$start = $end-$vv+1;
$objSheet->mergeCells('A'.$start.":".'A'.$end);
$objSheet->mergeCells('P'.$start.":".'P'.$end);
$objSheet->mergeCells('Q'.$start.":".'Q'.$end);
......
}
}
}
转载于:https://www.jianshu.com/p/10d99a8cd1ff
上一篇: 冬瓜排骨汤怎么熬好喝,需要哪些步骤!