输入banner图图片脚本导航/分类

thinkphp去重统计数据sql

->distinct(true)->field(‘userName‘)->select(); 解析的SQL:SELECT DISTINCT `userName` FROM `table`

去重统计:

$totalRows = $this->where($where)->count(‘DISTINCT mobilePhone‘)
解析的SQL:SELECT COUNT(DISTINCT mobilePhone) AS tp_count FROM `table` WHERE `check` = 1

原文作者:rinald