作者 王智

迭代接口

... ... @@ -160,6 +160,7 @@ class Question extends Backend
foreach ($data as $key => $vo) {
$k = $key + 2;
foreach ($columns as $key1 => $column) {
// dump($column);
$letter = IntToChr($key1);
$arr = explode('.', $column);
if (count($arr) > 1) {
... ... @@ -179,19 +180,23 @@ class Question extends Backend
$str = str_replace("=", "≈", $str);
}
if ($column == 'avatar' || $column == 'user.avatar' || $column == 'user.avatar') {
if ($column == 'avatar' || $column == 'user.avatar' || $column == 'quyuthird.avatar') {
if(!empty($str)){
$str = cdnurl($str);
$objActSheet->getCell("$letter" . "$k")
->setValue($str)
->getHyperlink()
->setUrl($str);
}else{
$objActSheet->setCellValue("$letter" . "$k", $str);
}
$objActSheet->getCell("$letter" . "$k")
->setValue($str)
->getHyperlink()
->setUrl($str);
} else {
$objActSheet->setCellValue("$letter" . "$k", $str);
}
}
}
// exit;
// Redirect output to a client’s web browser (Xlsx)
/*header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="01simple.xlsx"');
... ...