修正因为数据为空导致的问题

This commit is contained in:
muzi_ys 2022-08-07 21:59:31 +08:00
parent 16a0d26550
commit 481d0e2fcb
1 changed files with 1 additions and 1 deletions

View File

@ -604,7 +604,7 @@ function tpl_get_advert($type, int $row = 5)
if (!$row){
$row = 5;
}
return array_slice($advertList,0,$row);
return !empty($advertList)?array_slice($advertList,0,$row):$advertList;
}
/**