织梦CMS实现搜索只搜指定多栏目下的文章

分类:模板变量教程 发布时间:2019-05-08 20:04:01

摘要:织梦CMS如何&怎么实现搜索只搜指定多栏目下的文章?DEDE 实现搜索只搜指定多栏目下的文章教程&方法&说明,适用于织梦5.7

怎么实现搜索只搜指定多栏目下的文章?

方法1:

//统计列表里的记录

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

//搜索

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

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

方法2:

  1. <input type="hidden" name="typeid" value="特定栏目id">

 把它放在搜索form里面即可