Implement search pago

This commit is contained in:
2024-01-08 17:33:42 -03:00
parent bc2333bc95
commit d225011ae9
10 changed files with 288 additions and 22 deletions

View File

@ -35,4 +35,21 @@ class BonoPie extends Ideal\Repository
{
return $this->update($model, ['valor', 'pago'], $new_data);
}
public function fetchByValue(float $value): array
{
$query = $this->connection->getQueryBuilder()
->select()
->from($this->getTable())
->where('valor = ?');
return $this->fetchMany($query, [$value]);
}
public function fetchByPago(int $pago_id): Model\Venta\BonoPie
{
$query = $this->connection->getQueryBuilder()
->select()
->from($this->getTable())
->where('pago = ?');
return $this->fetchOne($query, [$pago_id]);
}
}