refactor: 视频分类默认选中问题

This commit is contained in:
2025-05-14 17:48:58 +08:00
parent c53d1f1bf9
commit a2973b5ec1
2 changed files with 3 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ class Attachment extends Common
])
->withSearch(['name'], ['name' => $param['keyword']??null])
->language($this->lang_id)
->category($param['id']??null)
->category($param['id']??$video_categorys[0]['id']??null)
->order(['sort' => 'asc', 'id' => 'desc'])
->paginate([
'list_rows' => $param['size'],

View File

@@ -36,8 +36,8 @@
{notempty name="video_categorys"}
<div class="hd">
<ul>
{volist name="video_categorys" id="vca"}
<li class="vli {eq name='vca.id' value='$Request.get.id'}von{/eq}">
{volist name="video_categorys" id="vca" key="k"}
<li class="vli {if condition='($Request.has.id && $Request.get.id==$vca.id) || (!$Request.has.id && $k==1)'}von{/if}">
<a href="{:url('attachment/video', ['id' => $vca.id])}" style="display: block;">{$vca.name}</a>
</li>
{/volist}