fix: pc 视频搜索

This commit is contained in:
2025-07-21 16:54:43 +08:00
parent f78f164326
commit 5650ccfb87
3 changed files with 11 additions and 9 deletions

View File

@@ -21,11 +21,13 @@ class Attachment extends Common
{
$param = request()->param([
'id',
'keyword',
'page/d' => 1,
'size/d' => 12,
'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'],