正在显示
1 个修改的文件
包含
10 行增加
和
9 行删除
| @@ -146,14 +146,15 @@ class ComController extends BaseController | @@ -146,14 +146,15 @@ class ComController extends BaseController | ||
| 146 | public function ceshi(){ | 146 | public function ceshi(){ |
| 147 | $from = new FormGlobalsoApi(); | 147 | $from = new FormGlobalsoApi(); |
| 148 | $list = $from->getInquiryList('https://demomark.globalso.com/','',1,100000000); | 148 | $list = $from->getInquiryList('https://demomark.globalso.com/','',1,100000000); |
| 149 | -// $arr = []; | ||
| 150 | -// foreach ($list['data'] as $k => $v){ | ||
| 151 | -// if(isset($arr[$v['country']])){ | ||
| 152 | -// $arr[$v['country']]['num']++; | ||
| 153 | -// }else{ | ||
| 154 | -// $arr[$v['country']]['num'] = 0; | ||
| 155 | -// } | ||
| 156 | -// } | ||
| 157 | - return (array)$list['data']['data']; | 149 | + $data = $list['data']['data']; |
| 150 | + $arr = []; | ||
| 151 | + foreach ($data as $k => $v){ | ||
| 152 | + if(isset($arr[$v['country']])){ | ||
| 153 | + $arr[$v['country']]['num']++; | ||
| 154 | + }else{ | ||
| 155 | + $arr[$v['country']]['num'] = 0; | ||
| 156 | + } | ||
| 157 | + } | ||
| 158 | + return $arr; | ||
| 158 | } | 159 | } |
| 159 | } | 160 | } |
-
请 注册 或 登录 后发表评论