fix: pc 视频搜索
This commit is contained in:
@@ -21,11 +21,13 @@ class Attachment extends Common
|
||||
{
|
||||
$param = request()->param([
|
||||
'id',
|
||||
'keyword',
|
||||
'keyword' => '',
|
||||
'page/d' => 1,
|
||||
'size/d' => 12,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
// 获取附件分类
|
||||
$categorys = AttachmentCategoryModel::field([
|
||||
'id',
|
||||
@@ -48,9 +50,9 @@ class Attachment extends Common
|
||||
'support_platform',
|
||||
'attach',
|
||||
])
|
||||
->withSearch(['name'], ['name' => $param['keyword']??null])
|
||||
->withSearch(['name'], ['name' => !empty($param['keyword']) ? $param['keyword'] : null])
|
||||
->language($this->lang_id)
|
||||
->category($param['id']??null)
|
||||
->category(!empty($param['id']) ? $param['id'] : $categorys[0]['id']??null)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->paginate([
|
||||
'list_rows' => $param['size'],
|
||||
@@ -109,9 +111,9 @@ class Attachment extends Common
|
||||
'video',
|
||||
'link'
|
||||
])
|
||||
->withSearch(['name'], ['name' => $param['keyword']??null])
|
||||
->withSearch(['name'], ['name' => !empty($param['keyword']) ? $param['keyword'] : null])
|
||||
->language($this->lang_id)
|
||||
->category($param['id']??$video_categorys[0]['id']??null)
|
||||
->category(!empty($param['id']) ? $param['id'] : $video_categorys[0]['id']??null)
|
||||
->order(['sort' => 'asc', 'id' => 'desc'])
|
||||
->paginate([
|
||||
'list_rows' => $param['size'],
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- 搜索 -->
|
||||
<form action="{:url('attachment/index')}" method="get">
|
||||
<div class="search_all">
|
||||
<input type="hidden" name="id" value="{$Request.get.id}" />
|
||||
<input type="hidden" name="id" value="{$Request.get.id??$categorys[0]['id']??''}" />
|
||||
<input type="text" name="keyword" placeholder="{:lang_i18n('搜索')}" />
|
||||
<button class="searchbtn" type="submit"><img src="__IMAGES__/search_blue.png" /></button>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<!-- 搜索 -->
|
||||
<form action="{:url('attachment/video')}" method="get">
|
||||
<div class="search_all">
|
||||
<input type="hidden" name="id" value="{$Request.get.id}" />
|
||||
<input type="hidden" name="id" value="{$Request.get.id??$video_categorys[0]['id']??''}" />
|
||||
<input type="text" name="keyword" placeholder="{:lang_i18n('搜索')}" />
|
||||
<button class="searchbtn" type="submit"><img src="__IMAGES__/search_blue.png" /></button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user