Created
July 23, 2019 17:42
-
-
Save Arkango/2158a2b0eb05f2092ae54ac258e0f391 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getCountByField($year,$field,$interessato_a = ''){ | |
$acceptable = ["citta","provincia" ,"source_potential" ,"campagna" ]; | |
if(in_array($acceptable,strtolower($field))){ | |
$whereClause = ($interessato_a == '') ? '' : " and interessato_a = ".$interessato_a; | |
return GQD('fl_leads_hrc',$field.", count(*) as cnt ","year(data_creazione) = ".$year." ".$whereClause." GROUP BY ".$field); | |
}else{ | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment