This commit is contained in:
make
2025-07-21 00:06:09 +08:00
parent b3419254c1
commit f63ebf417e

View File

@@ -258,18 +258,37 @@ $Novel.n_id{extend name="baseH5" /}
<span class="value"> <span class="value">
<span class="value-tag"> <span class="value-tag">
{if empty($Request.route.intForgeId)} {if empty($Request.route.intForgeId)}
{php}
$arrRandomForgeNovels = $arrNovel['n_forge_novel'];
{/php}
{volist name='$arrNovel.arrRelateveNovel' id='Novel' key="key"} {volist name='$arrNovel.arrRelateveNovel' id='Novel' key="key"}
{if !empty($arrGrm[$key + 24])} {if !empty($arrGrm[$key + 24])}
{$arrGrm[$key+24]|raw} {$arrGrm[$key+24]|raw}
{/if} {/if}
<a href='{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}'>{$Novel.n_name}</a>&nbsp;&nbsp; <a href='{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}'>{$Novel.n_name}</a>&nbsp;&nbsp;
{/volist} {/volist}
{else} {else}
{novel:list count="10" n_category="$arrNovel.n_category_pinyin" sort_type="news" d_key="d_key" d_val="Novel" diff_key="$Request.route.intForgeId" cache_life="1000"} {novel:list count="10" n_category="$arrNovel.n_category_pinyin" sort_type="update" d_key="d_key" d_val="Novel" diff_key="$Request.route.intForgeId" cache_life="1000"}
<a href='{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}'>{$Novel.n_name}</a>&nbsp;&nbsp; <a href='{site:nurl n_id="$Novel.n_id" n_py="$Novel.n_name_pinyin" /}'>{$Novel.n_name}</a>&nbsp;&nbsp;
{/novel:list} {/novel:list}
{php}
// 随机选取 10 条数据
$arrRorgeNovels = $arrNovel['n_forge_novel'];
if (count($arrRorgeNovels) > 10) {
$randomKeys = array_rand($arrRorgeNovels, 10);
$randomForgeNovels = array_intersect_key($arrRorgeNovels, array_flip($randomKeys));
} else {
$randomForgeNovels = $arrRorgeNovels;
shuffle($randomForgeNovels);
}
$arrRandomForgeNovels = array_values($randomForgeNovels); // 重置索引以确保 key 从 1 开始
{/php}
{/if} {/if}
{volist name='arrNovel.n_forge_novel' id='ForgeNovel' key="key"}
{volist name='arrRandomForgeNovels' id='ForgeNovel' key="key"}
{if !empty($arrGrm[$key + 34])} {if !empty($arrGrm[$key + 34])}
{$arrGrm[$key+34]|raw} {$arrGrm[$key+34]|raw}
{/if} {/if}
@@ -294,7 +313,7 @@ $Novel.n_id{extend name="baseH5" /}
</div> </div>
{else} {else}
<div class="work-list"> <div class="work-list">
{novel:list count="8" n_category="$arrNovel.n_category_pinyin" sort_type="update" d_key="d_key" d_val="Novel" diff_key="$Request.route.intForgeId" cache_life="3600"} {novel:list count="8" n_category="$arrNovel.n_category_pinyin" sort_type="all" d_key="d_key" d_val="Novel" diff_key="$Request.route.intForgeId" cache_life="1000"}
{include file="public/novel-list-flex" start="16"/} {include file="public/novel-list-flex" start="16"/}
{/novel:list} {/novel:list}
</div> </div>