Promociones

This commit is contained in:
Juan Pablo Vial
2025-03-25 19:22:38 -03:00
parent d3b0026ca4
commit b191a01313
12 changed files with 286 additions and 8 deletions

View File

@ -164,6 +164,21 @@ class Proyecto extends Ideal\Repository
->where('inmobiliaria = ?');
return $this->fetchMany($query, [$inmobiliaria_rut]);
}
/**
* @param int $promotion_id
* @return array
* @throws Implement\Exception\EmptyResult
*/
public function fetchByPromotion(int $promotion_id): array
{
$query = $this->connection->getQueryBuilder()
->select('a.*')
->from("{$this->getTable()} a")
->joined('INNER JOIN promotion_projects pp ON pp.project_id = a.id')
->where('pp.promotion_id = :promotion_id');
return $this->fetchMany($query, ['promotion_id' => $promotion_id]);
}
/*public function fetchSuperficieVendido(int $proyecto_id): float
{