mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
remove pedido_espera_by cast
This commit is contained in:
@ -63,7 +63,6 @@ class OrdenTrabajoEntity extends Entity
|
|||||||
"enviar_impresion" => "bool",
|
"enviar_impresion" => "bool",
|
||||||
"portada_path" => "string",
|
"portada_path" => "string",
|
||||||
"is_pedido_espera" => "bool",
|
"is_pedido_espera" => "bool",
|
||||||
"pedido_espera_by" => "?integer"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -124,9 +123,17 @@ class OrdenTrabajoEntity extends Entity
|
|||||||
$m = model(OrdenTrabajoFileModel::class);
|
$m = model(OrdenTrabajoFileModel::class);
|
||||||
return $m->where('orden_trabajo_id',$this->attributes['id'])->findAll() ?? [];
|
return $m->where('orden_trabajo_id',$this->attributes['id'])->findAll() ?? [];
|
||||||
}
|
}
|
||||||
public function pedidoEsperaBy() : UsersEntity
|
public function pedidoEsperaBy() : ?UsersEntity
|
||||||
{
|
{
|
||||||
$m = model(UserModel::class);
|
$m = model(UserModel::class);
|
||||||
return $m->findById($this->attributes['pedido_espera_by']);
|
if($this->attributes['pedido_espera_by']){
|
||||||
|
return $m->findById($this->attributes['pedido_espera_by']);
|
||||||
|
}else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function getPedidoEsperaBy(): ?UsersEntity
|
||||||
|
{
|
||||||
|
return $this->pedidoEsperaBy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user