diff --git a/app/index/controller/Attachment.php b/app/index/controller/Attachment.php index 468bb3c8..ae49b874 100644 --- a/app/index/controller/Attachment.php +++ b/app/index/controller/Attachment.php @@ -21,6 +21,7 @@ class Attachment extends Common { $param = request()->param([ 'id', + 'keyword', 'page/d' => 1, 'size/d' => 12, ]); @@ -47,6 +48,7 @@ class Attachment extends Common 'support_platform', 'attach', ]) + ->withSearch(['name'], ['name' => $param['keyword']??null]) ->language($this->lang_id) ->category($param['id']??null) ->order(['sort' => 'asc', 'id' => 'desc']) @@ -70,6 +72,7 @@ class Attachment extends Common { $param = request()->param([ 'id', + 'keyword', 'page/d' => 1, 'size/d' => 12 ]); @@ -106,6 +109,7 @@ class Attachment extends Common 'video', 'link' ]) + ->withSearch(['name'], ['name' => $param['keyword']??null]) ->language($this->lang_id) ->category($param['id']??null) ->order(['sort' => 'asc', 'id' => 'desc']) diff --git a/app/index/lang/en-us.php b/app/index/lang/en-us.php index ad0a50b9..0c90a2f7 100644 --- a/app/index/lang/en-us.php +++ b/app/index/lang/en-us.php @@ -33,9 +33,10 @@ return [ 'detail_recommend' => 'Recommended for you', ], 'attachment' => [ - 'software_drives' => 'Software and Drivers', - 'video' => 'Videos', - 'support_model' => 'Supported Models', - 'support_platform' => 'Supported Systems', + 'software_drives' => 'Software and Drivers', + 'video' => 'Videos', + 'support_model' => 'Supported Models', + 'support_platform' => 'Supported Systems', + 'search_placeholder' => 'Search model', ] ]; \ No newline at end of file diff --git a/app/index/lang/zh-cn.php b/app/index/lang/zh-cn.php index 1aeb67eb..10f84691 100644 --- a/app/index/lang/zh-cn.php +++ b/app/index/lang/zh-cn.php @@ -33,9 +33,10 @@ return [ 'detail_recommend' => '你可能还喜欢', ], 'attachment' => [ - 'software_drives' => '软件和驱动程序', - 'video' => '视频', - 'support_model' => '支持型号', - 'support_platform' => '支持系统', + 'software_drives' => '软件和驱动程序', + 'video' => '视频', + 'support_model' => '支持型号', + 'support_platform' => '支持系统', + 'search_placeholder' => '搜索型号', ] ]; \ No newline at end of file diff --git a/app/index/model/AttachmentModel.php b/app/index/model/AttachmentModel.php index d358f4ed..590d2a8f 100644 --- a/app/index/model/AttachmentModel.php +++ b/app/index/model/AttachmentModel.php @@ -22,6 +22,15 @@ class AttachmentModel extends AttachmentBaseModel // 设置JSON数据返回数组 protected $jsonAssoc = true; + // 附件名称搜索器 + public function searchNameAttr($query, $value, $data) + { + if (is_null($value)) { + return; + } + $query->where('name', 'like', "%{$value}%"); + } + // 所属语言范围查询 public function scopeLanguage($query, $language) { diff --git a/app/index/model/VideoModel.php b/app/index/model/VideoModel.php index 3ebbb1a1..3708ac91 100644 --- a/app/index/model/VideoModel.php +++ b/app/index/model/VideoModel.php @@ -18,6 +18,15 @@ class VideoModel extends VideoBaseModel // 软删除字段 protected $deleteTime = 'deleted_at'; + // 视频名称搜索器 + public function searchNameAttr($query, $value, $data) + { + if (is_null($value)) { + return; + } + $query->where('name', 'like', "%{$value}%"); + } + // 所属语言范围查询 public function scopeLanguage($query, $language) { diff --git a/app/index/view/attachment/index.html b/app/index/view/attachment/index.html index 03821bf2..fda7c37a 100644 --- a/app/index/view/attachment/index.html +++ b/app/index/view/attachment/index.html @@ -12,12 +12,13 @@
-
- -
- +
+
+ + +
-
+
{notempty name="categorys"} @@ -36,8 +37,8 @@
{:lang('attachment.video')}
- {notempty name="attachements"}
+ {notempty name="attachements"} {volist name="attachements" id="att"}
@@ -62,8 +63,10 @@
{/volist}
{$page|raw}
+ {else/} +
查询无结果!
+ {/notempty}
- {/notempty}
diff --git a/app/index/view/attachment/video.html b/app/index/view/attachment/video.html index 05ff143d..6447bbdc 100644 --- a/app/index/view/attachment/video.html +++ b/app/index/view/attachment/video.html @@ -12,12 +12,12 @@
-
- -
- +
+
+ +
-
+
{notempty name="attachment_categorys"} @@ -45,9 +45,9 @@
{/notempty} - {notempty name="videos"}
    + {notempty name="videos"}
    {volist name="videos" id="vo"}
    @@ -65,9 +65,11 @@
    {$page|raw}
    + {else/} +
    查询无结果!
    + {/notempty}
- {/notempty}
diff --git a/public/static/index/css/download.css b/public/static/index/css/download.css index 43d1b3f9..3576a89a 100755 --- a/public/static/index/css/download.css +++ b/public/static/index/css/download.css @@ -65,6 +65,8 @@ top: 50%; margin-top: -0.75rem; right: 6rem; + border: 0; + background-color: transparent; } .orico_Page_download .downloadMain .contact_c .search_all .searchbtn img { width: 100%; @@ -259,3 +261,6 @@ margin-top: 16px; line-height: 20px; } +.orico_Page_download .downloadMain .contact_c .video-empty { + padding-bottom: 3rem; +} diff --git a/public/static/index/images/search_blue.png b/public/static/index/images/search_blue.png new file mode 100755 index 00000000..a973810c Binary files /dev/null and b/public/static/index/images/search_blue.png differ