Separacion de Promocion de Contrato y Precio
"Simplificacion" de datos en listado de precios
This commit is contained in:
@ -185,6 +185,21 @@ class Unidad extends Ideal\Repository
|
||||
return $this->fetchOne($query, ['unidad_id' => $unidad_id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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_units` pu ON pu.`unit_id` = a.`id`')
|
||||
->where('pu.`promotion_id` = :promotion_id');
|
||||
return $this->fetchMany($query, ['promotion_id' => $promotion_id]);
|
||||
}
|
||||
|
||||
protected function joinProrrateo(): string
|
||||
{
|
||||
return "LEFT OUTER JOIN unidad_prorrateo up ON up.unidad_id = a.id";
|
||||
|
Reference in New Issue
Block a user