function generateNestedBlocks($level, $maxLevel, $columnId, $displayCount, $operationType, $showTitlePic, $additionalSql, $order) { if ($level > $maxLevel) { return ''; // 如果达到最大嵌套层级,则返回空字符串 } $ecms_bq_sql = sys_ReturnEcmsLoopBq($columnId, $displayCount, $operationType, $showTitlePic, $additionalSql, $order); $bqno = 0; $output = ''; while ($bqr = $empire->fetch($ecms_bq_sql)) { $bqsr = sys_ReturnEcmsLoopStext($bqr); $bqno++; // 输出当前层级的模板内容 $output .= "模板代码内容 <?=$bqr[title]?>\n"; // 递归调用以生成下一层级的嵌套块 $output .= generateNestedBlocks($level + 1, $maxLevel, $columnId, $displayCount, $operationType, $showTitlePic, $additionalSql, $order); } return $output; }
|