Thinkphp中distinct的用法


Thinkphp中distincat的用法

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);

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM