Heim >Backend-Entwicklung >PHP-Tutorial >Zählen Sie nach der Abfrage der Datenbank die Häufigkeit im Array und erzielen Sie den in der Abbildung gezeigten Effekt.
service_channel ist der Beschwerdekanal, die Anzahl der Beschwerden (c), die Anzahl der Beschwerden sollte (count(t)) gleich sein und) wie man den Effekt des Bildes unten erzielt, wenn mehrere Beschwerdekanäle vorhanden sind ? Ignorieren Sie die Details. Danke^_ ^
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 ist der Beschwerdekanal, die Anzahl der Beschwerden (c), die Anzahl der Beschwerden sollte (count(t)) gleich sein und) wie man den Effekt des Bildes unten erzielt, wenn mehrere Beschwerdekanäle vorhanden sind ? Ignorieren Sie die Details. Danke^_ ^
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>