ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯(lián)系官方銷售客服

1835022288

028-61286886

投訴 分享 統(tǒng)計(jì)欄目數(shù)據(jù) 51 0

模板標(biāo)簽里面

統(tǒng)計(jì)欄目數(shù)據(jù)
有效數(shù)據(jù):
{php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->countAllResults();}<br>
今日數(shù)據(jù):
{php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->where('DATEDIFF(from_unixtime(inputtime),now())=0')->countAllResults();}<br>
七日數(shù)據(jù):
{php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->where('DATEDIFF(now() , FROM_UNIXTIME(`inputtime`)) <= 7')->countAllResults();}<br>
欄目數(shù)據(jù):
{php echo \Phpcmf\Service::M()->db->table('1_news_index')->where('status=9')->where('catid=7')->countAllResults();}<br>

上面的代碼無法統(tǒng)計(jì)  多級(jí)欄目,如果一級(jí)要統(tǒng)計(jì)包含下級(jí)欄目的所有數(shù)據(jù),請(qǐng)下面的代碼

共享模塊欄目數(shù)據(jù):{intval(dr_share_cat_value(1, 'total'))}<br>
獨(dú)立模塊欄目數(shù)據(jù):{intval(dr_cat_value('demo', 1, 'total'))}

1_news_index :站點(diǎn)ID_模塊名字_index

其實(shí),1_news_index 也是數(shù)據(jù)庫(kù)表名字,你可以去看數(shù)據(jù)庫(kù)表名然后,舉一反三,做出更多統(tǒng)計(jì)

dr_cat_value('demo', 1, 'total'):dr_cat_value('模塊名字', 欄目ID, 'total')

共享欄目的統(tǒng)計(jì)不需要寫模塊名字了,其實(shí)官方為什么不把共享欄目的函數(shù),在模塊名字這里用 share 頂替呢?

比如 dr_cat_value('share', 1, 'total'),這樣代碼就少了一個(gè)函數(shù)!


總覺得……好像寫的很隨意!

解決方案