mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido margen a tarifas impresion
This commit is contained in:
@ -17,9 +17,10 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
|
||||
1 => "t1.tipo",
|
||||
2 => "t1.uso",
|
||||
3 => "t1.precio",
|
||||
4 => "t1.margen"
|
||||
];
|
||||
|
||||
protected $allowedFields = ["maquina_id", "tipo", "precio", "uso", "user_created_id", "user_updated_id", "is_deleted", "deleted_at", "created_at", "updated_at"];
|
||||
protected $allowedFields = ["maquina_id", "tipo", "precio", "uso", "margen", "user_created_id", "user_updated_id", "is_deleted", "deleted_at", "created_at", "updated_at"];
|
||||
protected $returnType = "App\Entities\Configuracion\MaquinasTarifasImpresionEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
@ -94,7 +95,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.tipo AS tipo, t1.precio AS precio, t1.uso AS uso"
|
||||
"t1.id AS id, t1.tipo AS tipo, t1.precio AS precio, t1.uso AS uso, t1.margen AS margen"
|
||||
);
|
||||
|
||||
//JJO
|
||||
@ -111,6 +112,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
|
||||
->orLike("t1.tipo", $search)
|
||||
->orLike("t1.precio", $search)
|
||||
->orLike("t1.uso", $search)
|
||||
->orLike("t1.margen", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.maquina_id", $search)
|
||||
->orLike("t1.tipo", $search)
|
||||
@ -124,7 +126,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.precio AS precio"
|
||||
"t1.id AS id, t1.precio AS precio, t1.margen AS margen"
|
||||
);
|
||||
|
||||
//JJO
|
||||
@ -135,7 +137,7 @@ class MaquinasTarifasImpresionModel extends \App\Models\GoBaseModel
|
||||
|
||||
$tarifas = $builder->get()->getResultArray();
|
||||
if (count($tarifas)>0){
|
||||
return [$tarifas[0]['id'], floatval($tarifas[0]['precio'])];
|
||||
return [$tarifas[0]['id'], floatval($tarifas[0]['precio']), floatval($tarifas[0]['margen'])];
|
||||
}
|
||||
return $tarifas;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user