thinkphp6 写了 distinct 还怎么定义要获取的数据库字段
在thinkphp6中,可以使用field方法来指定要获取的数据库字段。例如:
Db::table('table_name')->distinct(true)->field('column_name')->select();
这样就可以使用distinct去重,并且只获取column_name这个字段的数据。
原文地址: https://www.cveoy.top/t/topic/f6nG 著作权归作者所有。请勿转载和采集!