宝哥软件园

Thinkphp中distinct的用法分析

编辑:宝哥软件园 来源:互联网 时间:2021-09-06

在TP中使用distinct()主要是为了删除重复的值

Thinkphp手册中也有详细描述(链接:http://document.thinkphp.cn/manual_3_2.html#distinct)

以下是我个人的例子:

它显示了类似这样的东西

在添加不同的:

显示结果是

以下是发布的代码

$ offer num=M(' offer ')-distinct(true)-其中(' order_id=')。$ order _ id)-字段(' user_id,number ')-select();dump($ offer num);以上是边肖介绍的Thinkphp中distinct的用法分析。希望对大家有帮助。如果你有任何问题,请给我留言,边肖会及时回复你。非常感谢您对我们网站的支持!

更多资讯
游戏推荐
更多+