mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into 'mod/presupuesto_admin'
Main See merge request jjimenez/safekat!456
This commit is contained in:
@ -47,4 +47,13 @@ class ConfigVariableModel extends Model
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
public function getVariable($name)
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->where('name', $name);
|
||||
|
||||
return $builder->get()->getFirstRow();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
<?php
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class ConfiguracionSistemaModel extends \App\Models\BaseModel
|
||||
{
|
||||
protected $table = "configuracion_sistema";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $allowedFields = ["var_name", "value", "datatype"];
|
||||
protected $returnType = "App\Entities\Configuracion\ConfiguracionSistemaEntity";
|
||||
|
||||
public static $labelField = "var_name";
|
||||
|
||||
protected $validationRules = [
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
];
|
||||
|
||||
public function getPOD()
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
'(SELECT CAST(t1.value AS INT)) AS POD', false)
|
||||
->where('t1.var_name', 'POD');
|
||||
|
||||
$POD = intval($builder->get()->getFirstRow()->POD);
|
||||
return $POD;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user