SQL: select top {$Param(0)} b.title,b.id,a.sumamount from [select proid,sum(amount) as
sumamount from ks_orderitem where datediff('d',begindate,now())<=
{$Param(1)} group by proid].as a,ks_product as b where a.proid=b.id
html:
[loop={$Param(0)}]
<img src="/images/shuzi/1/$AutoID}.gif" valign="middle">
<a href="{$Field(id,GetInfoUrl,5,1}" title="{$Field(title,Text,0,...,0,)}"
target="_blank>{$Field(title,Text,0,...,0,)}</a></br>[/loop]