mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado tickets. faltan respuestas
This commit is contained in:
@ -12,6 +12,8 @@ class TicketModel extends \App\Models\BaseModel
|
||||
|
||||
protected $useTimestamps = true;
|
||||
|
||||
protected $returnType = "App\Entities\Soporte\TicketEntity";
|
||||
|
||||
const SORTABLE = [
|
||||
0 => "t1.categoria_id",
|
||||
1 => "t1.seccion_id",
|
||||
@ -75,14 +77,16 @@ class TicketModel extends \App\Models\BaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id as id, t1.usuario_id AS usuario_id, CONCAT(t2.first_name, ' ', t2.last_name) AS usuario,
|
||||
t1.user_soporte_id AS user_soporte_id, CONCAT(t2.first_name, ' ', t2.last_name) AS user_soporte,
|
||||
t1.categoria_id AS categoria_id, t3.keyword AS categoria, t1.seccion_id AS seccion_id, t1.estado_id AS estado_id,
|
||||
t1.user_soporte_id AS user_soporte_id, CONCAT(t6.first_name, ' ', t6.last_name) AS user_soporte,
|
||||
t1.categoria_id AS categoria_id, t3.keyword AS categoria,
|
||||
t1.seccion_id AS seccion_id, t5.keyword AS seccion,
|
||||
t1.estado_id AS estado_id, t4.keyword AS estado,
|
||||
t1.prioridad AS prioridad, t1.titulo AS titulo, t1.created_at AS created_at
|
||||
"
|
||||
);
|
||||
|
||||
$builder->join("users t2", "t1.usuario_id = t2.id", "left");
|
||||
$builder->join("users t2", "t1.user_soporte_id = t2.id", "left");
|
||||
$builder->join("users t6", "t1.user_soporte_id = t6.id", "left");
|
||||
$builder->join("tickets_categorias t3", "t1.categoria_id = t3.id", "left");
|
||||
$builder->join("tickets_estados t4", "t1.estado_id = t4.id", "left");
|
||||
$builder->join("tickets_secciones t5", "t1.seccion_id = t5.id", "left");
|
||||
@ -122,6 +122,19 @@ class UserModel extends ShieldUserModel
|
||||
|
||||
}
|
||||
|
||||
public function getFullName($id=0){
|
||||
$builder = $this->db
|
||||
->table("users" . " t1")
|
||||
->select(
|
||||
"CONCAT(t1.first_name, ' ', t1.last_name) AS name"
|
||||
);
|
||||
|
||||
$builder->where('t1.deleted_at', null);
|
||||
$builder->where('t1.id', $id);
|
||||
|
||||
return $builder->get()->getRow()->name;
|
||||
}
|
||||
|
||||
// Método para comprobar si el email ya está registrado
|
||||
public function isEmailUnique($email)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user