thinkphp的column()函数
2023-03-29 23:03:03
209
{{single.collect_count}}

因为需求要数据库查询之后以{key:value}的方式返回数据,在网上找了好久都没有详细的使用方法,补充一下顺便排雷:
column(field,key)函数查询的结果以键值对的方式返回,key为键,field为值
重点:在键值对为小数的时候,key和field的数据类型一定不能为同一种数据类型,否则就会返回数据错误

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}