| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function fetchAttribution($address) |
||
| 28 | { |
||
| 29 | $res = Http::get('https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php', [ |
||
| 30 | 'query' => $address, |
||
| 31 | 'resource_id' => '6006', |
||
| 32 | 'oe' => 'utf8', |
||
| 33 | ]); |
||
| 34 | $data = Json::get($res, 'data.0.location', false); |
||
| 35 | if (is_string($data)) { |
||
| 36 | list($this->_result['city'], $this->_result['type']) = Arrays::lists(explode(' ', $data), 2); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $this; |
||
| 40 | } |
||
| 42 |