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