查询栏目所有可以显示 的 并且勾选在产品中心展示 的栏目,
但是当我查询的时候,
单用
{category module=share show=1 sfzcpzxzs=1}
{/category}
{$debug}
查出来的数据是错的,

然后我就想到写sql
{php $query=urlencode('select * from @#1_share_category where show = 1 and sfzcpzxzs=1');}
{sql sql='$query' return=v}
{/sql}
{$debug}
写完就报错

但是show 这个字段我又绕不过去,


{php $query=urlencode('select * from @#1_share_category where `show` = 1 and `sfzcpzxzs`=1');} {sql sql='$query' return=v} {/sql} {$debug}这样才对,sql语句,每个字段都需要``包起来
{category module=share show=1} {/category}show=1表示显示隐藏的栏目,也就四显示全部栏目{category module=share show=0} 这样表示不显示隐藏栏目 {/category}注意:category标签不能填写自定义字段参数 是无效的参考文档:《模块共享栏目列表循环》这样where 不行是吗 {php $where = urlencode("(sfzcpzxzs=1)");} {category module=share where=$where show=1} {/category}团子吃西瓜
{category module=share show=1} {if $t.sfzcpzxzs==1} {/if} {/category}写以判断就行了吧