这里写代码片
$sql = "SELECT concat( date_format( FROM_UNIXTIME(record_time), '%H:' ) , floor( date_format( FROM_UNIXTIME(record_time), '%i' )/ 3) * 3 ) AS c, SUM(player_role_num) AS n
FROM fa_service_message
WHERE service_id = $service_id and platform_id = $platform_id and channel_id = $channel_id and record_time BETWEEN $nows and $nextDay
GROUP BY c
ORDER BY id ASC";
//record_time 为table 的column