Heim  >  Artikel  >  Backend-Entwicklung  >  查询数据库后数组统计次数,并实现如图效果?

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

WBOY
WBOYOriginal
2016-08-08 09:06:54883Durchsuche

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

<code>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)</code>

1 =>

<code>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)</code>

2 =>

<code>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)</code>

3 =>

<code>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)</code>

4 =>

<code>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)</code>

5 =>

<code>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)</code>

6 =>
13 =>

<code>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)</code>

14 =>

<code>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)</code>

15 =>

<code>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)</code>

16 =>

<code>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)</code>

17 =>

<code>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)</code>

18 =>

<code>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)</code>

19 =>

<code>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)</code>

20 =>

<code>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)
</code>

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

回复内容:

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

<code>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)</code>

1 =>

<code>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)</code>

2 =>

<code>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)</code>

3 =>

<code>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)</code>

4 =>

<code>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)</code>

5 =>

<code>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)</code>

6 =>
13 =>

<code>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)</code>

14 =>

<code>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)</code>

15 =>

<code>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)</code>

16 =>

<code>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)</code>

17 =>

<code>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)</code>

18 =>

<code>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)</code>

19 =>

<code>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)</code>

20 =>

<code>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)
</code>

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

<code>select create_time,service_channel,c,count(*) as '人数' from a group by create_time,service_channel,c</code>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:php的链式调用Nächster Artikel:javascript - ajax简单请求缓慢