34 lines
694 B
PHP
34 lines
694 B
PHP
<?php
|
|
namespace Incoviba\nuevo\Common;
|
|
|
|
use App\Alias\NewModel;
|
|
|
|
/**
|
|
*
|
|
* @author Aldarien
|
|
* @property int id
|
|
* @property double util
|
|
* @property double logia
|
|
* @property double terraza
|
|
* @property double cubierta
|
|
* @property double terreno
|
|
*
|
|
*/
|
|
class M2 extends NewModel
|
|
{
|
|
protected static $_table = 'm2s';
|
|
|
|
public function unidades()
|
|
{
|
|
return $this->has_many(\Incoviba\nuevo\Proyecto\UnidadProyecto::class, 'm2_id')->findMany();
|
|
}
|
|
public function vendibles()
|
|
{
|
|
return $this->util + $this->logia + $this->terraza / 2 + $this->cubierta / 3;
|
|
}
|
|
public function total()
|
|
{
|
|
return $this->util + $this->logia + $this->terraza + $this->cubierta;
|
|
}
|
|
}
|