這是finecms 的模板,有這樣的一個循環,展示的是會員發內布的交易信息,每個信息裡面又有其他會員的回复,這個回复裡有金額,用PHP寫了個運算(只是顯示,沒寫入資料庫),可是它只算兩條以內的和,如何能讓每個資訊裡的所有回執金額相加成總數呢?
{list modelid=27 order=updatetime num=10 more=1} {php $id = $t['id'];} <a href="{$t['url']}"> <li style="position:relative;"> <div class="jyxx">{strcut(strip_tags($t['shangjia']),12,"")}</div><div class="jyxx">{strcut(strip_tags($t['title']),12,"")}</div><div class="jyxx">{strcut(strip_tags($t['jiaoyixiangmu']),12,"")}</div><div class="jyxx">¥{$t['jiaoyijine']}元</div> {list form=jiaoyi cid=$id order=id return=d} <?php $a= $d['huizhijine']; $g = $d['lingqubili']; $dd = $c; $c = $a *100 /$g; $dd +=$c; $e = $d['jiaoyijine'] - $dd; $f = $e *$g /100; $h = $dd /$t['jiaoyijine'] *100;?> <h1 class="indhz">最近领取:{date("Y年m月d日",$d['updatetime'])}来{$d['huizhishangjia']}领取{$d['huizhijine']} 元 {$d['huizhichanpin']}--计{$c}</h1> {/list} 总{$dd} </li> </a> {/list}
已解決