Mas cambios de controles

This commit is contained in:
2020-01-07 10:19:43 -03:00
parent affaf514fb
commit 2300ca5641
2 changed files with 11 additions and 1 deletions

View File

@ -315,8 +315,8 @@ class Cierre extends Model
if (!$estado) {
$data['fecha'] = $fecha->format('Y-m-d');
$estado = model(EstadoCierre::class)->create($data);
$estado->setContainer($this->container);
$estado->save();
$estado->setContainer($this->container);
}
}
protected $promesa;
@ -354,4 +354,12 @@ class Cierre extends Model
$dif = $today->diffInDays($this->fecha());
return $dif;
}
public function toArray() {
$arr = $this->asArray();
$arr['proyecto'] = $this->proyecto()->asArray();
if ($this->propietario()) {
$arr['propietario'] = $this->propietario()->asArray();
}
return $arr;
}
}