Thinkphp 中 distinct 的用法解析

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

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

下面是我的个人例子:

显示的是这样的

在加入distinct的话:

显示结果为

下面为贴出来的代码

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

更多内容:http://www.wangzhanjianshegs.com/网站建设

posted @ 2017-01-13 11:13  堕落白天使  阅读(2064)  评论(0编辑  收藏  举报