|
|
|
|
|
|
|
|
return TicketInterface::class; |
|
|
return TicketInterface::class; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function filterStatus($query, $statusArray) |
|
|
|
|
|
{ |
|
|
|
|
|
$query->andWhere('e.status IN (:status)')->setParameter('status', $statusArray) ; |
|
|
|
|
|
return $query ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function findAllOpen() |
|
|
public function findAllOpen() |
|
|
{ |
|
|
{ |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query = $this->findByMerchantQuery() ; |
|
|
$query->andWhere('e.status IN (:statusOpen)')->setParameter('statusOpen', [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ; |
|
|
|
|
|
|
|
|
$this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ; |
|
|
$query->addOrderBy('e.id', 'DESC') ; |
|
|
$query->addOrderBy('e.id', 'DESC') ; |
|
|
return $query->getQuery()->getResult() ; |
|
|
return $query->getQuery()->getResult() ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function countAllOpen() |
|
|
|
|
|
{ |
|
|
|
|
|
$query = $this->findByMerchantQuery() ; |
|
|
|
|
|
$query->select('count(e.id)'); |
|
|
|
|
|
$this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ; |
|
|
|
|
|
return $query->getQuery()->getSingleScalarResult() ; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|