迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架, 基于MIT开源许可协议发布,不限制商业使用,以多端互联为设计理念, 支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
模板标签里面
如何统计会员在某个表发布了多少条信息?
{module module=news catid=1 uid=$t.uid more=1 order=displayorder_desc,updatetime num=5}
uid会员在news表的catid总共发布了多少条信息?
{/module }
<?php $18html_com = \Phpcmf\Service::M()->db->table('1_news')->where('uid', $t.uid)->countAll(); echo $18html_com; ?>
<?php $www_18html_com = \Phpcmf\Service::M()->db->table('1_news')->where('uid', $t.uid)->countAll(); echo $www_18html_com; ?>
$www_18html_com = \Phpcmf\Service::M()->where("uid",$t.uid)->counts("1_news");
catid限最终栏目
{php echo\Phpcmf\Service::M()->db->table('1_news')->where('catid', $t.catid)->where('uid', $t.uid)->countAll();}
{php echo\Phpcmf\Service::M()->db->table('1_news')->where('catid', $t.catid)->where('uid', 1)->countAll();}
{php echo\Phpcmf\Service::M()->db->table('1_xiutu')->where('uid', $member.uid)->countAll();}
{php echo\Phpcmf\Service::M()->db->table('1_xiutu')->where('uid', $member.uid)->countAllResults();}
countAllResults
<?php $18html_com = \Phpcmf\Service::M()->db->table('1_news')->where('uid', $t.uid)->countAll(); echo $18html_com; ?><?php $www_18html_com = \Phpcmf\Service::M()->db->table('1_news')->where('uid', $t.uid)->countAll(); echo $www_18html_com; ?><?php $www_18html_com = \Phpcmf\Service::M()->db->table('1_news')->where('uid', $t.uid)->countAll(); echo $www_18html_com; ?>这个也不行,调出来表中所有会员信息,也就是where('uid', $t.uid)无效了。{$t.uid}是能调出的,看看是哪不对?$www_18html_com = \Phpcmf\Service::M()->where("uid",$t.uid)->counts("1_news");{module module=news catid=1 uid=$t.uid more=1 order=displayorder_desc,updatetime num=5}
uid会员在news表的catid总共发布了多少条信息?
catid限最终栏目
{php echo\Phpcmf\Service::M()->db->table('1_news')->where('catid', $t.catid)->where('uid', $t.uid)->countAll();}{/module }
{php echo\Phpcmf\Service::M()->db->table('1_news')->where('catid', $t.catid)->where('uid', 1)->countAll();}直接把 $t.uid 改成 会员ID 1 测试一样无效{php echo\Phpcmf\Service::M()->db->table('1_xiutu')->where('uid', $member.uid)->countAll();}没有问题的。{php echo\Phpcmf\Service::M()->db->table('1_xiutu')->where('uid', $member.uid)->countAllResults();}ci手册里面才是统计输出