雨鸶

do what U love , love what U do ! 路漫漫其修远兮,吾将上下而求索

导航

FreeMaker实现变量求和

    今天在项目上遇到统计分页页面的某个字段的总和,前台页面是使用FreeMaker实现的,记录一下:

<#assign tprice = 0 >
<#list  orderlist as order >
      <#if order.price??>
            <#assign tprice = tprice + order.price >
       </#if>
</#list>
${tprice }  <!#-- 输出结果 -->

posted on 2016-04-21 15:46  hezhh  阅读(739)  评论(0编辑  收藏  举报