业务经理

微信扫描以上二维码

028-61286886

技术咨询

今天在做搜索功能的时候发现很怪,搜索不出东西来

迅睿框架 更新 2020-12-30 11:28:27 万俟肸

今天在做搜索功能的时候发现很怪,搜索不出东西来,翻看以前的案例也是不行,

//搜索框
<form action="/index.php" method="get" class="spotForm">
<input type="hidden" name="s" value="business">
<input type="hidden" name="c" value="search">
    <div class="spotItem">
         <div class="spotItemTitle">Model</div>
         <input class="spotItemInput" type="text" name="title">
    </div>
    <div class="spotItem">
         <div class="spotItemTitle">Classification</div>
         <select class="spotItemInput" name="classification">
               <option>classification1</option>
         </select>
    </div>
    <div class="spotItem">
         <div class="spotItemTitle">Brand</div>
         <select class="spotItemInput" name="brand">
               <option>brand1</option>
         </select>
    </div>
    <div class="spotItem2">
         <input class="spotItemInput2" type="submit" value="Search">
    </div>
</form>

搜索结果页地址

/index.php?s=business&c=search&title=271&classification=classification1&brand=brand1




后台模块搜索中的字段也点了


{xunruicms_img_title}


但是结果搜索了个寂寞


{xunruicms_img_title}



我在头部写了个链接


{Router::search_url($params, 'keyword', 'spot','business')}


搜索也地址是

/index.php?s=business&c=search&keyword=spot


这个就能搜索出东西


{xunruicms_img_title}


到底是啥原因造成有大佬指点一二嘛

方案

  • 迅睿框架技术-吴金辉 #1 · 2020-12-30 10:02:41


    这里错了,改成keyword
  • 万俟肸 #2 · 2020-12-30 10:07:03
    迅睿框架技术-吴金辉 这里是三个筛选条件,第一个就是产品的标题,第二个是类型,第三个是品牌, 把标题改成keyword是不是不对

  • 万俟肸 #3 · 2020-12-30 10:08:59
    迅睿框架技术-吴金辉
    <form action="/index.php" method="get" class="spotForm">
    <input type="hidden" name="s" value="business">
    <input type="hidden" name="c" value="search">
        <div class="spotItem">
             <div class="spotItemTitle">Model</div>
             <input class="spotItemInput" type="text" name="keyword">
        </div>
        <div class="spotItem">
             <div class="spotItemTitle">Classification</div>
             <select class="spotItemInput" name="classification">
                   <option>classification1</option>
             </select>
        </div>
        <div class="spotItem">
             <div class="spotItemTitle">Brand</div>
             <select class="spotItemInput" name="brand">
                   <option>brand1</option>
             </select>
        </div>
        <div class="spotItem2">
             <input class="spotItemInput2" type="submit" value="Search">
        </div>
    </form>


    /index.php?s=business&c=search&keyword=271&classification=classification1&brand=brand1不对,还是搜索了个寂寞
  • 迅睿框架技术-吴金辉 #4 · 2020-12-30 10:09:20
    目前的版本办不到这种功能,要等下个版本,可以设置and匹配方式万俟肸
  • 万俟肸 #5 · 2020-12-30 10:16:51
    满意答案
    迅睿框架技术-吴金辉 我之前一个案例用4.1.10做的是可以呀
  • 万俟肸 #6 · 2020-12-30 11:28:27
    @万俟肸:把每个input中的name改成name="params[字段]"就解决了

迅睿系统漏洞

AI文章生成器
AI文章生成器(2026-09-20)
任务拆分独立配置 新增AI生成关键词 新增指令模板 新增品牌信...
GEO系统
GEO系统(2026-09-20)
后台 AEO 与运营端对齐:区域、跑批、CSV、补强、剧本均可在迅睿...
多语言翻译Seolang
多语言翻译Seolang(2026-09-18)
1. HTML lang 无需修改模板,自动适配当前语种页面 lan...
GeoSeo工具箱
GeoSeo工具箱(2026-09-18)
修正菜单规范
后台二次登陆验证
后台二次登陆验证(2026-09-18)
新增邮箱验证 新增短信验证
京东云短信
京东云短信(2026-09-17)
- 验证码有效期改只读展示 - 有效期旁新增系统设置按钮 - 保...
创蓝短信
创蓝短信(2026-09-17)
- 验证码有效期改只读展示 - 有效期旁新增系统设置按钮 - 保...
火山引擎短信
火山引擎短信(2026-09-17)
- 验证码有效期改只读展示 - 有效期旁新增系统设置按钮 - 保...
外贸多语言建站
外贸多语言建站(2026-09-17)
优化独立内容过滤机制