当前位置:首页 > PHP教程 > PHP常见问题

Thinkphp中distinct的用法解析

tp中distinct()的用处主要是去除重复的值

在thinkphp手册中也详细说明了(链接:http://document.thinkphp.cn/manual_3_2.html#distinct)

下面是我的个人例子:

显示的是这样的

在加入distinct的话:

显示结果为

下面为贴出来的代码

$offernum = m('offer')->distinct(true)->where('order_id='.$order_id)->field('user_id,number')->select(); dump($offernum);

以上所述是小编给大家介绍的thinkphp 中 distinct 的用法解析,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对硕编程网站的支持!



【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!