FreeMaker list 列求和函数

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<#function sum >  
	  <#local sum = 0>  
	  <#list courseCategoryXXTotal as total>  
	 <#local sum = sum + total.total>  
	  </#list>  
	  <#if courseCategoryXXTotal?size != 0> 
	  <#return sum > 
	   </#if>
 </#function> 
合计: ${sum()}

<!-- 培训报名人数 --> 
		<#assign applyList=report.applyList />
		<#function sum >  
		  <#local sum = 0>  
		  <#list applyList as apply>  
		    <#if apply.apply_status = 1>
		      <#local sum = sum +1>
		    </#if>
		  </#list>  
		   <#return sum > 
		</#function>
        <span><b>培训中:</b><em> ${sum()}</em>人</span>
        <!-- 培训结束人数 -->
		<#function sum1 >  
		  <#local sum1 = 0>  
		  <#list applyList as apply>  
		    <#if apply.apply_status = 3>
		      <#local sum1 = sum1 +1>
		    </#if>
		  </#list>  
		   <#return sum1 > 
		</#function>  
        <span><b>结束:</b><em> ${sum1()}</em>人</span></dd>