destoon循环嵌套查询

想了两天都没理清思路,今天下午经过经理点播终于搞出来了,循环调用嵌套还可以这样用。只要两个表内由相关字段,都可以进行关联查询。

<!–{php $tags=tag(“moduleid=4&condition=level=1&length=28&pagesize=6&order=userid desc&template=null”);}–> 

<div class=””>

<ul class=”clearfix comp”>

{loop $tags $i $t}

<li class=”comp_li”>

<div class=”clearfix comp_logo”>

<a href=”{$t[linkurl]}” target=”_blank”><img class=”” alt=”{$t[title]}” src=http://www.baihang8899.com/skin/default/image/nopic.gif>

<a href=”{$t[linkurl]}” title=”{$t[title]}” target=”_blank”>{$t[company]}</a><br/>

<span>{$t[business]}</span>

</div>

<div class=”mall_sell clearfix”>

<!–{php $mall=tag(“moduleid=16&condition=username=‘”.$t[username].”‘&pagesize=3&template=null”);}–>

{loop $mall $v}

<a href=”{$v[linkurl]}” target=”_blank”>

<img class=”comp_img” alt=”{$t[alt]}” src=http://www.baihang8899.com/skin/default/image/nopic.gif />

<p>{$DT[money_sign]}{$v[price]}{if $v[unit]}<span class=”mall_unit”>/{$v[unit]}</span>{/if}</p>

{/loop}

</a> 

</div>

<div class=”clearfix comp_address”>

<p class=””>联系电话:{$t[telephone]}</p>

<a href=”{$t[linkurl]}”>进入商家店铺</a>

</div>

</li>

{/loop}

</ul>

</div>