讯睿cms-搜索关键词和下拉时间筛选功能
模板:
<script>
// 这段js是用来执行搜索的
function dr_module_search(name) {
var url="{Router::search_url($params, ['keyword'], ['mykeyword'])}";
var keyword = $("#q").val();
if (keyword) {
url = url.replace('mykeyword', keyword);
} else {
url = url.replace('mykeyword', '');
}
location.href=url;
return false;
}
</script>
<script>
$(".noticetime select").change(function(){
var dq_date = $("#inputtime_filter").val();
//var url = '/index.php?s=news&c=search&catid={$catid}&ajax_page=myajax.html&page=1&inputtime='+dq_date;
var now_date = Date.now();
var mys = dq_date+','+now_date;
var url = "{Router::search_url($params, 'inputtime', 'myinputtime')}";
if (mys) {
url = url.replace('myinputtime', mys);
} else {
url = url.replace('mykeyword', '');
}
location.href=url;
})
</script>