mysql语句求按字段分组后组数是多少 select count(distinct ID) from table Thinkphp CURD写 $count = $model->where($where)->count('distinct 字段名');