织梦自定义搜索结果页显示自定义字段

打开/puls/advancedsearch.php文件

找到

$query = "select arctype.* FROM $addontable addon

  left join dede2_arctype arctype on arctype.id=addon.typeid

  $where $orderby";

 } else {

  $query = "select main.id as aid,main.*,main.description as description1, type.*

 from $maintable main

 left join dede2_arctype type on type.id=main.typeid

 left join $addontable addon on addon.aid=main.id

 $where  $orderby";

改成

$query = "select addon.*, arctype.* from $addontable addon

  left join dede2_arctype arctype on arctype.id=addon.typeid

  $where $orderby";

 } else {

  $query = "select addon.*,main.id as aid,main.*,main.description as description1, type.*

 from $maintable main

 left join dede2_arctype type on type.id=main.typeid

 left join $addontable addon on addon.aid=main.id

 $where  $orderby";

一共有处都需要修改

显示结果要修改模板文件,在plus/advancedsearch.htm,{dede:datalist}中直接调用{dede:field.字段名称/}就OK了

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zyzjzf.html