迅睿CMS框架是一款PHP8高性能·簡單易用的CMS開源開發(fā)框架,基于MIT開源許可協(xié)議發(fā)布,免費(fèi)且不限制商業(yè)使用,是免費(fèi)開源的產(chǎn)品,以萬端互聯(lián)為設(shè)計(jì)理念,支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
模板標(biāo)簽里面
怎么計(jì)算category循環(huán)出來的10個欄目的本周數(shù)據(jù)之和,參照http://m.223987.com/doc/1114.html 這個教程,調(diào)用不出來
代碼如下
<table class="layui-table"> <thead> <tr> <th>序號</th> <th>單位</th> <th>數(shù)量</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>合計(jì)</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>
category標(biāo)簽的num不支持5,10的寫法
{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} 之和的數(shù)據(jù){$cts}
回復(fù)@迅??蚣芗夹g(shù)-徐老師 理論上category標(biāo)簽是不支持num=5,10 但是我在實(shí)際使用過程中,就是按照我想顯示的效果顯示出來了對應(yīng)的欄目。另外用你的方法合計(jì)是顯示出來了,但是欄目后面的數(shù)量沒有顯示
{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} 之和的數(shù)據(jù){$cts}
回復(fù)@迅??蚣芗夹g(shù)-徐老師 感謝解答,完美解決
代碼如下
category標(biāo)簽的num不支持5,10的寫法
回復(fù)@迅??蚣芗夹g(shù)-徐老師 理論上category標(biāo)簽是不支持num=5,10 但是我在實(shí)際使用過程中,就是按照我想顯示的效果顯示出來了對應(yīng)的欄目。另外用你的方法合計(jì)是顯示出來了,但是欄目后面的數(shù)量沒有顯示
回復(fù)@迅??蚣芗夹g(shù)-徐老師 感謝解答,完美解決