作者 lyh

gx

@@ -76,9 +76,11 @@ class InquiryMonthlyCount extends Command @@ -76,9 +76,11 @@ class InquiryMonthlyCount extends Command
76 //总数 76 //总数
77 $arr['total'] = $inquiry_list['data']['total'] ?? 0; 77 $arr['total'] = $inquiry_list['data']['total'] ?? 0;
78 //数据详情 78 //数据详情
79 - $data = $inquiry_list['data']['data']; 79 + $data = $inquiry_list['data']['data'] ?? 0;
80 $arr['month_total'] = 0; 80 $arr['month_total'] = 0;
81 $countryArr = []; 81 $countryArr = [];
  82 + $arr['count'] = "";
  83 + if(!empty($data)){
82 foreach ($data as $v){ 84 foreach ($data as $v){
83 if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){ 85 if(($startTime.' 00:00:00' <= $v['submit_time']) && $v['submit_time'] <= $endTime.' 23:59:59'){
84 $arr['month_total']++; 86 $arr['month_total']++;
@@ -92,6 +94,7 @@ class InquiryMonthlyCount extends Command @@ -92,6 +94,7 @@ class InquiryMonthlyCount extends Command
92 arsort($countryArr); 94 arsort($countryArr);
93 $top20 = array_slice($countryArr, 0, 15, true); 95 $top20 = array_slice($countryArr, 0, 15, true);
94 $arr['country'] = json_encode($top20); 96 $arr['country'] = json_encode($top20);
  97 + }
95 return $arr; 98 return $arr;
96 } 99 }
97 100