Fixes for upgrade
This commit is contained in:
@ -39,17 +39,16 @@ function uf($date, $async = false) {
|
||||
return (object) ['total' => 0];
|
||||
}
|
||||
$url = 'http://' . config('locations.money') . '/api/uf/value/' . $date->format('Y-m-d');
|
||||
$client = new \Goutte\Client();
|
||||
$client->setHeader('Accept', 'application/json');
|
||||
$client->request('GET', $url);
|
||||
$client = new \GuzzleHttp\Client(['base_uri' => 'http://' . config('locations.money') . '/', 'headers' => ['Accept' => 'application/json']]);
|
||||
$response = $client->get('api/uf/value/' . $date->format('Y-m-d'));
|
||||
|
||||
$response = $client->getResponse();
|
||||
//$response = $client->getResponse();
|
||||
if (!$response) {
|
||||
return (object) ['total' => 0];
|
||||
}
|
||||
$status = $response->getStatusCode();
|
||||
if ($status >= 200 and $status < 300) {
|
||||
$data = json_decode($response->getContent());
|
||||
$data = json_decode($response->getBody()->getContents());
|
||||
return $data;
|
||||
}
|
||||
return (object) ['total' => 0];
|
||||
|
Reference in New Issue
Block a user