|
...
|
...
|
@@ -62,28 +62,28 @@ class MonthCountLogic extends BaseLogic |
|
|
|
* @time :2023/6/30 14:29
|
|
|
|
*/
|
|
|
|
public function inquiryCount(&$arr,&$startTime,&$endTime,$domain){
|
|
|
|
//TODO::上线后注释
|
|
|
|
// $domain = 'https://demomark.globalso.com/';
|
|
|
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
|
|
|
|
//总数
|
|
|
|
$arr['total'] = $inquiry_list['data']['total'] ?? 0;
|
|
|
|
//数据详情
|
|
|
|
$data = $inquiry_list['data']['data'];
|
|
|
|
$arr['month_total'] = 0;
|
|
|
|
$countryArr = [];
|
|
|
|
foreach ($data as $v){
|
|
|
|
if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){
|
|
|
|
$arr['month_total']++;
|
|
|
|
}
|
|
|
|
if(isset($countryArr[$v['country']])){
|
|
|
|
$countryArr[$v['country']]++;
|
|
|
|
}else{
|
|
|
|
$countryArr[$v['country']] = 0;
|
|
|
|
if(!empty($inquiry_list)){
|
|
|
|
//总数
|
|
|
|
$arr['total'] = $inquiry_list['data']['total'] ?? 0;
|
|
|
|
//数据详情
|
|
|
|
$data = $inquiry_list['data']['data'];
|
|
|
|
$arr['month_total'] = 0;
|
|
|
|
$countryArr = [];
|
|
|
|
foreach ($data as $v){
|
|
|
|
if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){
|
|
|
|
$arr['month_total']++;
|
|
|
|
}
|
|
|
|
if(isset($countryArr[$v['country']])){
|
|
|
|
$countryArr[$v['country']]++;
|
|
|
|
}else{
|
|
|
|
$countryArr[$v['country']] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
arsort($countryArr);
|
|
|
|
$top20 = array_slice($countryArr, 0, 15, true);
|
|
|
|
$arr['country'] = $top20;
|
|
|
|
}
|
|
|
|
arsort($countryArr);
|
|
|
|
$top20 = array_slice($countryArr, 0, 15, true);
|
|
|
|
$arr['country'] = $top20;
|
|
|
|
return $arr;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|