Fixes de telefono y apellido de persona
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
namespace Incoviba\Service;
|
||||
|
||||
use DateTimeImmutable;
|
||||
use DateTimeZone;
|
||||
use InvalidArgumentException;
|
||||
use OutOfRangeException;
|
||||
use PDOException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Implement\Exception\EmptyRedis;
|
||||
@ -65,9 +65,9 @@ class Job extends Ideal\Service
|
||||
*/
|
||||
public function add(array $configuration): Model\Job
|
||||
{
|
||||
$now = (new DateTimeImmutable());
|
||||
$now = (new DateTimeImmutable('now', new DateTimeZone($_ENV['TZ'] ?? 'America/Santiago')));
|
||||
$data = [
|
||||
'id' => $now->getTimestamp(),
|
||||
'id' => $now->format('Uu'),
|
||||
'configuration' => $configuration,
|
||||
'executed' => false,
|
||||
'created_at' => $now->format('Y-m-d H:i:s'),
|
||||
@ -129,8 +129,10 @@ class Job extends Ideal\Service
|
||||
*/
|
||||
protected function findJob(array $jobs, int $id): int
|
||||
{
|
||||
$idx = array_find_key($jobs, fn($job) => $job['id'] === $id);
|
||||
if ($idx === false) {
|
||||
$idx = array_find_key($jobs, function($job) use ($id) {
|
||||
return (int) $job['id'] === $id;
|
||||
});
|
||||
if ($idx === null) {
|
||||
throw new EmptyResult("SELECT * FROM jobs WHERE id = ?");
|
||||
}
|
||||
return $idx;
|
||||
|
Reference in New Issue
Block a user