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.
34 lines
761 B
34 lines
761 B
<?php |
|
|
|
namespace app\Models; |
|
|
|
use app\Core\Model; |
|
|
|
/** |
|
* Description of Ramal |
|
* |
|
* @author Lucas Awade |
|
*/ |
|
class SystemMessage extends Model |
|
{ |
|
|
|
private $table = 'md_system_message'; |
|
|
|
public function findMessage($momento, $fila = null) |
|
{ |
|
$data = []; |
|
$data['momento'] = $momento; |
|
$this->query = "SELECT * FROM {$this->table} m WHERE 1=1"; |
|
|
|
if (!empty($fila)) { |
|
$data['fila'] = $fila; |
|
$this->query .= " AND (m.fila = :fila OR m.fila IS null)"; |
|
} else { |
|
$this->query .= " AND m.fila IS null"; |
|
} |
|
|
|
|
|
$this->query .= " AND m.momento = :momento ORDER BY ordem"; |
|
return $this->read($this->query, $data)->fetchAll(); |
|
} |
|
} |