首页 > CMS > 织梦DEDE > 正文

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

2024-07-09 22:51:41
字体:
来源:转载
供稿:网友

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

方法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里面即可

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表