pbootcms未搜索到任何数据实现多条件搜索

2025-08-04 0 9

1、数据库中有内容而页面提示 未搜索到任何数据

解决方案:

在前半部分添加一个标签 scode=*

代表搜索所有栏目内容

{pboot:search num=12 order=sorting scode=* field=’title|content’}
{/pboot:search}

pbootcms未搜索到任何数据实现多条件搜索

简单搜索代码示例

<form action=”{pboot:scaction}” method=”get”>
关键字:<input type=”text” name=”keyword” >
<button type=”submit”>搜索</button>
</form>

多条件搜索代码示例

可以通过隐藏字段,指定搜索的栏目

<form action=”{pboot:scaction}” method=”get”>
内容:<input type=”text” name=”content” >
标题:<input type=”text” name=”title” >
作者:<input type=”text” name=”author” >
<input type=”hidden” name=”scode” value=”2,3″ >
<button type=”submit”>搜索</button>
</form>

搜索结果列表

{pboot:search}
<a href=”search:link”>search:title</a>
{/pboot:search}

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

版权声明:所有的源码、软件和资料,不得使用于非法商业用途,不得违反国家法律,一切关于该资源商业行为与本站无关。

免费cms模板 pbootcms教程 pbootcms未搜索到任何数据实现多条件搜索 https://www.mianfeicms.com/1386.html

相关文章

发表评论
暂无评论