mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminada faja
This commit is contained in:
@ -112,8 +112,9 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
|
||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getTarifaPresupuestoManipulado($tarifa_id, $tirada){
|
||||
|
||||
public function getTarifaPresupuestoManipulado($tarifa_id, $tirada)
|
||||
{
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
@ -125,15 +126,22 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
|
||||
->where("t1.is_deleted", 0)
|
||||
//->where("t1.mostrar_en_presupuesto", 1)
|
||||
->where("t2.is_deleted", 0);
|
||||
|
||||
$builder->where('t1.id =', $tarifa_id);
|
||||
|
||||
// check if tarifa_id is an array
|
||||
if (is_array($tarifa_id)) {
|
||||
// check if tarifa_id['id'] exists
|
||||
$builder->where('t1.id', array_key_exists('id', $tarifa_id)? $tarifa_id['id']:$tarifa_id['tarifa_id']);
|
||||
} else {
|
||||
$builder->where('t1.id', $tarifa_id);
|
||||
}
|
||||
|
||||
$builder->where('t2.tirada_min <=', $tirada);
|
||||
$builder->where('t2.tirada_max >=', $tirada);
|
||||
|
||||
|
||||
return $builder->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getNombreTarifaManipulado($id=-1)
|
||||
public function getNombreTarifaManipulado($id = -1)
|
||||
{
|
||||
/*
|
||||
Todos los servicios de encuadernacion activas que se pueden usar en presupuestos
|
||||
@ -142,9 +150,13 @@ class TarifaManipuladoModel extends \App\Models\BaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.nombre AS nombre"
|
||||
)
|
||||
->where("t1.id", $id)
|
||||
->where("t1.is_deleted", 0);
|
||||
);
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
if (is_array($id)) {
|
||||
$builder->where("t1.id", $id['id']);
|
||||
} else
|
||||
$builder->where("t1.id", $id);
|
||||
|
||||
|
||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user