讯睿CMS问答:{dr_count($top.catids)} 统计全部下级栏目的数量

讯睿CMS问答:{dr_count($top.catids)} 统计全部下级栏目的数量

2024-04-24 XunRuiCMS Sincere

问题:

{dr_count($top.catids)} 统计全部下级栏目的数量,这个统计包括了下级栏目下的子栏目。有没有办法只统计下级栏目,不包括3级,4级的栏目。

答案:

不能

{count action=sql sql='select id from dr_1_share_category where pid=$top.id')}

我怎么把这个结果用到模板中if判断语句中去,

@nemo:{count action=sql sql='select id from dr_1_share_category where pid=$top.id' return=nums}查到了,加 return=nums