$query = "select 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";
第二步:修改第一步中的查询语句,添加自定义字段查询内容,加上“,addon.* ”如下:
$query = "select main.id as aid,main.*,main.description as description1, type.* ,addon.*
from $maintable main
left join dede_arctype type on type.id=main.typeid
left join $addontable addon on addon.aid=main.id
$where $orderby";