Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function fetchAttribution($number) |
||
28 | { |
||
29 | $res = Http::get('https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php', [ |
||
30 | 'resource_name' => 'guishudi', |
||
31 | 'query' => $number, |
||
32 | 'oe' => 'utf8', |
||
33 | ]); |
||
34 | $data = Json::get($res, 'data.0', []); |
||
35 | if (!empty($data)) { |
||
36 | $this->_result = [ |
||
37 | 'city' => I::get($data, 'city'), |
||
38 | 'province' => I::get($data, 'prov'), |
||
39 | 'type' => I::get($data, 'type'), |
||
40 | ]; |
||
41 | } |
||
42 | |||
43 | return $this; |
||
44 | } |
||
46 |