当前位置:Gxlcms > PHP教程 > 查询数据库后数组统计次数,并实现如图效果?

查询数据库后数组统计次数,并实现如图效果?

时间:2021-07-01 10:21:17 帮助过:30人阅读

service_channel为投诉渠道 ,投诉次数(c),投诉人数的应该为(count(t) 相同的次数和) 有多个投诉渠道怎么实现下面这张图的效果? 明细忽略.. 谢谢^_^
0 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

1 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

2 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

3 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

4 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

5 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

6 =>
13 =>

array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

14 =>

array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

15 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

16 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

17 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

18 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

19 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

20 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

回复内容:

service_channel为投诉渠道 ,投诉次数(c),投诉人数的应该为(count(t) 相同的次数和) 有多个投诉渠道怎么实现下面这张图的效果? 明细忽略.. 谢谢^_^
0 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

1 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

2 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

3 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

4 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

5 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '12' (length=2)

6 =>
13 =>

array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

14 =>

array (size=4)
  'c' => string '6' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

15 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

16 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

17 =>

array (size=4)
  'c' => string '4' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

18 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

19 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

20 =>

array (size=4)
  'c' => string '2' (length=1)
  'create_time' => string '2016-08-04' (length=10)
  'archivepath_name' => string '1天' (length=75)
  'service_channel' => string '29' (length=2)

select create_time,service_channel,c,count(*) as '人数' from a group by create_time,service_channel,c

人气教程排行