迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
做一个搜索,按照发表人和时间范围还有关键字搜索,这个按照时间范围搜索套用不上呀
<script type="text/javascript"> $(function () { //区间时间插件 $("input[name='date2']").daterangepicker( { // autoApply: true, autoUpdateInput: false, // alwaysShowCalendars: true, ranges: { '今天': [moment(),moment()], '昨天': [moment().subtract(1, 'days'),moment().subtract(1, 'days')], '近7天': [moment().subtract(7, 'days'), moment()], '这个月': [moment().startOf('month'), moment().endOf('month')], '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] }, locale: { format: "YYYY/MM/DD HH:MM:SS", separator: " - ", applyLabel: "确认", cancelLabel: "清空", fromLabel: "开始时间", toLabel: "结束时间", customRangeLabel: "自定义", daysOfWeek: ["日","一","二","三","四","五","六"], monthNames: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"] } } ).on('cancel.daterangepicker', function(ev, picker) { $("#date2").val("请选择日期范围"); $("#startTime").val(""); $("#endTime").val(""); }).on('apply.daterangepicker', function(ev, picker) { $("#startTime").val(picker.startDate.format('YYYY-MM-DD')); $("#endTime").val(picker.endDate.format('YYYY-MM-DD')); $("#date2").val(picker.startDate.format('YYYY-MM-DD')+" 至 "+picker.endDate.format('YYYY-MM-DD')); let sj=picker.startDate.format('YYYY-MM-DD')+","+picker.endDate.format('YYYY-MM-DD'); console.log(sj) window.location.href=`{Router::search_url($params, 'updatetime', ${sj} , 'news')}`; }); }); </script>
updatetime=2017-10-10,2019-10-10
let sj=picker.startDate.format('YYYY-MM-DD')+","+picker.endDate.format('YYYY-MM-DD'); console.log(sj) var = "{Router::search_url($params, 'updatetime', "finecms" , 'news')}"; url = url.replace('finecms', sj); window.location. href= url;