正在显示
1 个修改的文件
包含
15 行增加
和
3 行删除
| @@ -144,8 +144,20 @@ class ComController extends BaseController | @@ -144,8 +144,20 @@ class ComController extends BaseController | ||
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | public function ceshi(){ | 146 | public function ceshi(){ |
| 147 | -// $from = new FormGlobalsoApi(); | ||
| 148 | -// $list = $from->getInquiryList('https://demomark.globalso.com/','',1,100000000); | ||
| 149 | -// return $list; | 147 | + $inquiry_list = (new FormGlobalsoApi())->getInquiryList('https://demomark.globalso.com/','',1,100000000); |
| 148 | + //询盘国家统计 | ||
| 149 | + $countryData = $inquiry_list['data']['data']; | ||
| 150 | + $countryArr = []; | ||
| 151 | + foreach ($countryData as $v1){ | ||
| 152 | + if(isset($countryArr[$v1['country']])){ | ||
| 153 | + $countryArr[$v1['country']]++; | ||
| 154 | + }else{ | ||
| 155 | + $countryArr[$v1['country']] = 0; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + arsort($countryArr); | ||
| 159 | + $top20 = array_slice($countryArr, 0, 20, true); | ||
| 160 | + return $top20; | ||
| 161 | + | ||
| 150 | } | 162 | } |
| 151 | } | 163 | } |
-
请 注册 或 登录 后发表评论