Added schedule:list, fixed traffic import service, fixed invoice generation with charges and credit amounts
This commit is contained in:
6
app/Classes/External/Supplier.php
vendored
6
app/Classes/External/Supplier.php
vendored
@@ -40,7 +40,7 @@ abstract class Supplier
|
||||
'query'=>[
|
||||
$this->login_user_field=>$this->o->stats_username,
|
||||
$this->login_pass_field=>$this->o->stats_password,
|
||||
$this->date_field=>$this->o->stats_lastupdate,
|
||||
$this->date_field=>$this->o->stats_lastupdate->format('Y-m-d'),
|
||||
],
|
||||
/*
|
||||
'headers' => [
|
||||
@@ -52,7 +52,7 @@ abstract class Supplier
|
||||
$api_remain = Arr::get($result->getHeader('X-RateLimit-Remaining'),0);
|
||||
$api_reset = Arr::get($result->getHeader('X-RateLimit-Reset'),0);
|
||||
|
||||
if ($api_remain == 0) {
|
||||
if ($api_remain === 0 AND $api_reset) {
|
||||
Log::error('API Throttle.',['m'=>__METHOD__]);
|
||||
Cache::put('api_throttle',$api_reset,now()->addSeconds($api_reset));
|
||||
}
|
||||
@@ -86,7 +86,7 @@ abstract class Supplier
|
||||
$this->_columns = $expect;
|
||||
|
||||
if ($this->_columns->diff($fields)->count()) {
|
||||
abort('500','Missing columns in data: '.join('|',$this->_columns->diff($fields)->toArray()));
|
||||
abort('500','Missing columns in data: '.join('|',$this->_columns->diff($fields)->toArray()).' got: '.join('|',$fields));
|
||||
}
|
||||
|
||||
return $fields->intersect($this->_columns);
|
||||
|
Reference in New Issue
Block a user