在 thinkphp6 中,可以使用 select 方法来获取多个数据库字段。例如:

Db::table('my_table')
    ->distinct(true)
    ->field('field1, field2, field3')
    ->select();

这个例子中,我们使用了 field 方法来指定要获取的多个数据库字段。在这里,我们指定了 field1field2field3 三个字段。同时,我们也使用了 distinct 方法来去除重复的记录。

thinkphp6 写了 distinct 还怎么定义要获取的多个数据库字段

原文地址: https://www.cveoy.top/t/topic/f6oz 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录