在dede:arclist、dede:list等标签中调用附加字段

思路:根据主表ID对附加表进行关联查询,即可。

以下实例:

{dede:list perpage='20'}
					

[field:title/]

[field:description/]...

地址:
[field:id runphp="yes"] $dsql = new DedeSql(false); $sql="SELECT qiba.address from `dede_addonqiba` as qiba where qiba.aid=@me"; $arcRow = $dsql->GetOne($sql); @me=''.$arcRow['address'].''; [/field:id]
乘车路线:
[field:id runphp="yes"] $dsql = new DedeSql(false); $sql="SELECT qiba.roadline from `dede_addonqiba` as qiba where qiba.aid=@me"; $arcRow = $dsql->GetOne($sql); @me=''.$arcRow['roadline'].''; [/field:id]
电话:
[field:id runphp="yes"] $dsql = new DedeSql(false); $sql="SELECT qiba.telephone from `dede_addonqiba` as qiba where qiba.aid=@me"; $arcRow = $dsql->GetOne($sql); @me=''.$arcRow['telephone'].''; [/field:id]

评分:

[field:id runphp="yes"] @me=rating_bar(@me,5); [/field:id]
{/dede:list}


你可能感兴趣的:(DedeCMS)