织梦advancedsearch.php高级自定义模型字段无法调用解决方案
1
打开修改puls/advancedsearch.php文件,找到复制代码(不同版本可能有所差别)-
$query
=
"SELECT addon.*, arctype.* FROM $addontable addonLEFT JOIN arctype ON arctype.id = addon.typeid
$where $orderby"
;
}
else{
=
"SELECT main.id AS aid,main.*,main.description AS description1, type.*FROM $maintable main
LEFT JOIN type ON type.id = main.typeid
LEFT JOIN $addontable addon ON addon.aid = main.id
$where $orderby"
;
- $query = "SELECT addon.*, arctype.* FROM $addontable addon
2
然后 再改这段-
else
{
-
=
"SELECT main.id AS aid,main.*,main.description AS description1, type.*FROM $maintable main
LEFT JOIN type ON type.id = main.typeid
LEFT JOIN $addontable addon ON addon.aid = main.id
$where $orderby"
;
-
else
{
-
=
"select addon.*,main.id as aid,main.*,main.description as description1, type.*from $maintable main
left join dede_arctype type on type.id=main.typeid
left join $addontable addon on addon.aid=main.id
$where $orderby"
;
就是
- $query = "SELECT main.id AS aid,main.*,main.description AS description1, type.*
- $query = "select addon.*,main.id as aid,main.*,main.description as description1, type.*
所以所有版本改后的代码为:
-
$query
=
"select addon.*, arctype.* from $addontable addonleft join dede_arctype arctype on arctype.id=addon.typeid
$where $orderby"
;
}
else{
=
"select addon.*,main.id as aid,main.*,main.description as description1, type.*from $maintable main
left join dede_arctype type on type.id=main.typeid
left join $addontable addon on addon.aid=main.id
$where $orderby"
;