Cambio en queue para que no quede pegado esperando respuesta en cli.
Chequeo de servicios externos para agregar elementos pendientes.
This commit is contained in:
@ -43,6 +43,11 @@ class Subscription extends Ideal\Repository
|
||||
return $this->update($model, ['venta_id', 'toku_id', 'updated_at'], array_merge($new_data, ['updated_at' => (new DateTimeImmutable())->format('Y-m-d H:i:s')]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $venta_id
|
||||
* @return Model\Venta\MediosPago\Toku\Subscription
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByVenta(int $venta_id): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
@ -51,6 +56,12 @@ class Subscription extends Ideal\Repository
|
||||
->where('venta_id = :venta_id');
|
||||
return $this->fetchOne($query, compact('venta_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $toku_id
|
||||
* @return Model\Venta\MediosPago\Toku\Subscription
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByTokuId(string $toku_id): Model\Venta\MediosPago\Toku\Subscription
|
||||
{
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
@ -59,4 +70,19 @@ class Subscription extends Ideal\Repository
|
||||
->where('toku_id = :toku_id');
|
||||
return $this->fetchOne($query, compact('toku_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $ventas_ids
|
||||
* @return array
|
||||
* @throws Implement\Exception\EmptyResult
|
||||
*/
|
||||
public function fetchByVentas(array $ventas_ids): array
|
||||
{
|
||||
$idsQuery = implode(', ', array_fill(0, count($ventas_ids), '?'));
|
||||
$query = $this->connection->getQueryBuilder()
|
||||
->select()
|
||||
->from($this->getTable())
|
||||
->where("venta_id IN ({$idsQuery})");
|
||||
return $this->fetchMany($query, $ventas_ids);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user