Container
This commit is contained in:
@ -25,7 +25,7 @@ class AvanceConstruccion extends Model
|
||||
public function fecha(\DateTime $fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
$this->fecha = $fecha->format('Y-m-d');
|
||||
}
|
||||
@ -52,7 +52,7 @@ class AvanceConstruccion extends Model
|
||||
public function uf()
|
||||
{
|
||||
if ($this->uf == 0) {
|
||||
$uf = uf($this->fecha());
|
||||
$uf = $this->container->get('uf')($this->fecha());
|
||||
if ($uf->total > 0) {
|
||||
$this->uf = $uf->uf->value;
|
||||
$this->save();
|
||||
@ -70,7 +70,7 @@ class AvanceConstruccion extends Model
|
||||
public function fechaPago(\DateTime $fecha = null)
|
||||
{
|
||||
if ($fecha == null) {
|
||||
return Carbon::parse($this->fecha_pagado, config('app.timezone'));
|
||||
return Carbon::parse($this->fecha_pagado, $this->container->get('settings')->app->timezone);
|
||||
}
|
||||
$this->fecha_pagado = $fecha->format('Y-m-d');
|
||||
}
|
||||
|
Reference in New Issue
Block a user