forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.6 KiB
50 lines
1.6 KiB
<?php |
|
|
|
namespace app\Models; |
|
|
|
use app\Core\Model; |
|
|
|
class Evento extends Model |
|
{ |
|
private $evento = 'md_evento'; |
|
|
|
public function createEvento($uniqueid, $evento, $data_evento, $data_reg, $fila = null, $matricula = null) |
|
{ |
|
$this->query = "INSERT INTO {$this->evento} (uniqueid, |
|
evento, |
|
data_evento, |
|
data_reg, |
|
fila, |
|
matricula ) |
|
VALUES(:uniqueid, |
|
:evento, |
|
:data_evento, |
|
:data_reg, |
|
:fila, |
|
:matricula );"; |
|
|
|
$data['uniqueid'] = $uniqueid; |
|
$data['evento'] = $evento; |
|
$data['data_evento'] = $data_evento; |
|
$data['data_reg'] = $data_reg; |
|
$data['fila'] = $fila; |
|
$data['matricula'] = $matricula; |
|
|
|
$return = $this->create($this->query, $data); |
|
return $return; |
|
} |
|
|
|
public function findEventFinish($uniqueid) |
|
{ |
|
$this->query = "SELECT * FROM {$this->evento} |
|
WHERE uniqueid = :uniqueid |
|
AND evento in ('COMPLETE_AGENT', 'COMPLETE_AGENT');"; |
|
return $this->read($this->query, ['uniqueid' => $uniqueid])->fetch(); |
|
} |
|
|
|
public function getStatusAtendimento($uniqueid) |
|
{ |
|
$this->query = "SELECT evento FROM {$this->evento} WHERE uniqueid = :uniqueid ORDER BY id DESC LIMIT 1"; |
|
return $this->read($this->query, ['uniqueid' => $uniqueid])->fetch(); |
|
} |
|
} |