update: add knowledge search

This commit is contained in:
tokumeikoi 2022-08-26 17:14:23 +08:00
parent eebdf79b68
commit e1a523b363
11 changed files with 28 additions and 14 deletions

View File

@ -41,11 +41,19 @@ class KnowledgeController extends Controller
'data' => $knowledge 'data' => $knowledge
]); ]);
} }
$knowledges = Knowledge::select(['id', 'category', 'title', 'updated_at']) $builder = Knowledge::select(['id', 'category', 'title', 'updated_at'])
->where('language', $request->input('language')) ->where('language', $request->input('language'))
->where('show', 1) ->where('show', 1)
->orderBy('sort', 'ASC') ->orderBy('sort', 'ASC');
->get() $keyword = $request->input('keyword');
if ($keyword) {
$builder = $builder->where(function ($query) use ($keyword) {
$query->where('title', 'LIKE', "%{$keyword}%")
->orWhere('body', 'LIKE', "%{$keyword}%");
});
}
$knowledges = $builder->get()
->groupBy('category'); ->groupBy('category');
return response([ return response([
'data' => $knowledges 'data' => $knowledges

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -233,7 +233,7 @@ window.settings.i18n['en-US'] = {
'工单历史': 'Ticket History', '工单历史': 'Ticket History',
'已用流量将在 {reset_day} 日后重置': 'Used data will reset after {reset_day} days', '已用流量将在 {reset_day} 日后重置': 'Used data will reset after {reset_day} days',
'已用流量已在今日重置': 'Data usage has been reset today', '已用流量已在今日重置': 'Data usage has been reset today',
'重置已用流量': '重置已用流量', '重置已用流量': 'Reset used data',
'查看节点状态': 'View Access Point status', '查看节点状态': 'View Access Point status',
'当前已使用流量达{rate}%': 'Currently used data up to {rate}%', '当前已使用流量达{rate}%': 'Currently used data up to {rate}%',
'节点名称': 'Access Point Name', '节点名称': 'Access Point Name',
@ -267,5 +267,6 @@ window.settings.i18n['en-US'] = {
'按周期': 'By Cycle', '按周期': 'By Cycle',
'遇到问题': 'I have a problem', '遇到问题': 'I have a problem',
'遇到问题可以通过工单与我们沟通': 'If you have any problems, you can contact us via ticket', '遇到问题可以通过工单与我们沟通': 'If you have any problems, you can contact us via ticket',
'按流量': 'Pay As You Go' '按流量': 'Pay As You Go',
'搜索文档': '搜索文档'
}; };

View File

@ -267,5 +267,6 @@ window.settings.i18n['ja-JP'] = {
'按周期': '周期別', '按周期': '周期別',
'遇到问题': '遇到问题', '遇到问题': '遇到问题',
'遇到问题可以通过工单与我们沟通': '遇到问题可以通过工单与我们沟通', '遇到问题可以通过工单与我们沟通': '遇到问题可以通过工单与我们沟通',
'按流量': '按流量' '按流量': '按流量',
'搜索文档': '搜索文档'
}; };

View File

@ -267,5 +267,6 @@ window.settings.i18n['ko-KR'] = {
'按周期': '按周期', '按周期': '按周期',
'遇到问题': '遇到问题', '遇到问题': '遇到问题',
'遇到问题可以通过工单与我们沟通': '遇到问题可以通过工单与我们沟通', '遇到问题可以通过工单与我们沟通': '遇到问题可以通过工单与我们沟通',
'按流量': '按流量' '按流量': '按流量',
'搜索文档': '搜索文档'
}; };

View File

@ -267,5 +267,6 @@ window.settings.i18n['vi-VN'] = {
'按周期': 'Chu kỳ', '按周期': 'Chu kỳ',
'遇到问题': 'Chúng tôi có một vấn đề', '遇到问题': 'Chúng tôi có một vấn đề',
'遇到问题可以通过工单与我们沟通': 'Nếu bạn gặp sự cố, bạn có thể liên lạc với chúng tôi thông qua ', '遇到问题可以通过工单与我们沟通': 'Nếu bạn gặp sự cố, bạn có thể liên lạc với chúng tôi thông qua ',
'按流量': '按流量' '按流量': '按流量',
'搜索文档': '搜索文档'
}; };

View File

@ -267,5 +267,6 @@ window.settings.i18n['zh-CN'] = {
'按周期': '按周期', '按周期': '按周期',
'遇到问题': '遇到问题', '遇到问题': '遇到问题',
'遇到问题可以通过工单与我们沟通': '遇到问题可以通过工单与我们沟通', '遇到问题可以通过工单与我们沟通': '遇到问题可以通过工单与我们沟通',
'按流量': '按流量' '按流量': '按流量',
'搜索文档': '搜索文档'
}; };

View File

@ -267,5 +267,6 @@ window.settings.i18n['zh-TW'] = {
'按周期': '按週期', '按周期': '按週期',
'遇到问题': '遇到問題', '遇到问题': '遇到問題',
'遇到问题可以通过工单与我们沟通': '遇到問題您可以通過工單與我們溝通', '遇到问题可以通过工单与我们沟通': '遇到問題您可以通過工單與我們溝通',
'按流量': '按流量' '按流量': '按流量',
'搜索文档': '搜索文档'
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long