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