假设 A模型:news B模型:shop 关联字段id,取值B模型字段tt,统计点击onclick吧
增加模板时list.var模板需要勾选“使用程序代码”选项
$s=$empire->fetch1("select sum(onclick) as tool from {$dbtbpre}ecms_shop where classid='$r[classid]' limit 1"); $t=$empire->fetch1("select tt from {$dbtbpre}ecms_shop where id='$r[id]' limit 1"); $listtemp='<li><a href="[!--titleurl--]">[!--title--]</a> <span>B模型字段:'.$t[tt].'</span><span>B点击:'.$s[tool].'</span></li>';
|