feat/ot-datatable-news

This commit is contained in:
amazuecos
2025-05-02 07:56:28 +02:00
parent 9283059f9d
commit 5138681718
14 changed files with 346 additions and 65 deletions

View File

@ -178,6 +178,12 @@ class OrdenTrabajoTareaEntity extends Entity
$m = model(OrdenTrabajoTareaProgressDate::class);
return $m->where('ot_tarea_id', $this->attributes["id"])->findAll() ?? [];
}
public function lastState() : ?OrdenTrabajoTareaProgressDateEntity
{
$m = model(OrdenTrabajoTareaProgressDate::class);
$progressDates = $m->where('ot_tarea_id', $this->attributes["id"])->orderBy('action_at', 'DESC')->first();
return $progressDates;
}
public function tiempo_trabajado()
{
$dates = $this->progress_dates();