代码:
AppointmentModel::field(['identity'])->count('distinct identity')
生成的sql:
SELECT COUNT(DISTINCT `identity`) AS think_count FROM `dg_appointment`;
下面是tp6手册内容
我尝试着这样写 发现生成的sql不对
AppointmentModel::distinct(true)->field(['identity'])->count('identity');
SELECT DISTINCT COUNT(`identity`) AS think_count FROM `dg_appointment` ;