加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > CMS系统 > Dedecms > 正文

DEDE 实现搜索只搜指定多栏目下的文章

发布时间:2020-12-14 05:09:35 所属栏目:Dedecms 来源:网络整理
导读:共有两种方式,通过测试第一种比较的好用。如果只是单独的调用一个栏目那么用第二种方法比较的好。 方法1: //统计列表里的记录 $cquery = "Select * From `archives` arc where arc.typeid not in (1,2,3...) and {$this-AddSql}"; //搜索 ? ? ? ? ? ? ? ?
共有两种方式,通过测试第一种比较的好用。如果只是单独的调用一个栏目那么用第二种方法比较的好。
方法1:
//统计列表里的记录

$cquery = "Select * From `archives` arc where arc.typeid not in (1,2,3...) and {$this->AddSql}";

//搜索
????????$query = "Select arc.*,act.typedir,act.typename,act.isdefault,act.defaultname,act.namerule,
????????act.namerule2,act.ispart,act.moresite,act.siteurl,act.sitepath
????????from `archives` arc left join `arctype` act on arc.typeid=act.id
????????where??act.id not in (4,5,6....) and {$this->AddSql} $ordersql limit $limitstart,$row";

把sql语句换成我这两句,括号里面的是你不搜索栏目的id

方法2:
?把它放在搜索form里面即可

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读