怎么计算category循环出来的10个栏目的本周数据之和 迅睿框架 更新 2021-04-28 12:22:12 猴子哥哥 模板标签里面怎么计算category循环出来的10个栏目的本周数据之和,参照https://www.xunruicms.com/doc/1114.html 这个教程,调用不出来
<table class="layui-table"> <thead> <tr> <th>序号</th> <th>单位</th> <th>数量</th> </tr> </thead> <tbody> {category module=news pid=2 num=5,10 cache=3600} <tr> <td>{$key+1}</td> <td>{$t.name}</td> <td>{count action=module module=news catid=$t.id WEEK_updatetime=0 return=l}{$l_count}</td> </tr> {/category} <tr> <td>合计</td> <td colspan="2">{sum sum=$l_count action=module module=news catid=16,17,18,19,20,21,22,23,24,25 WEEK_updatetime=0 return=h}{$h_sum}</td> </tr> </tbody> </table>{php $cts=0;} {category module=news pid=2 num=10 cache=3600} <tr> <td>{$key+1}</td> <td>{$t.name}</td> <td>{count action=module module=news catid=$t.id WEEK_updatetime=0 return=l}{php $cts+=$l_count}</td> </tr> {/category} 之和的数据{$cts}{php $cts=0;} {category module=news pid=2 num=10 cache=3600} <tr> <td>{$key+1}</td> <td>{$t.name}</td> <td>{count action=module module=news catid=$t.id WEEK_updatetime=0 return=l}{php $cts+=$l_count; echo $l_count;}</td> </tr> {/category} 之和的数据{$cts}