I would like to ask: Why does PHP only calculate the addition of two pieces of data? How can you find the sum of all numbers?
刘畅
刘畅 2020-08-31 18:35:16
0
1
984

This is the template of finecms. There is such a loop, which displays the transaction information posted by members. Each information contains replies from other members. This reply contains the amount, and an operation is written in PHP ( It is only displayed, not written to the database), but it only calculates the sum of two items. How can we add all the receipt amounts in each message to the total?

{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}

未标题-1.jpg

刘畅
刘畅

reply all(1)
刘畅

solved

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template