mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
modificado el listado de maquinas
This commit is contained in:
@ -14,22 +14,13 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
const SORTABLE = [
|
||||
//1 => "t1.id",
|
||||
0 => "t1.nombre",
|
||||
0 => "t1.id",
|
||||
1 => "t2.nombre",
|
||||
2 => "t1.tipo",
|
||||
3 => "t1.velocidad",
|
||||
4 => "t1.duracion_jornada",
|
||||
5 => "t1.ancho",
|
||||
6 => "t1.alto",
|
||||
7 => "t1.ancho_impresion",
|
||||
8 => "t1.alto_impresion",
|
||||
9 => "t1.orden_planning",
|
||||
10 => "t1.min",
|
||||
11 => "t1.max",
|
||||
|
||||
|
||||
];
|
||||
3 => "t1.ancho_impresion",
|
||||
4 => "t1.alto_impresion",
|
||||
5 => "t1.min",
|
||||
6 => "t1.max", ];
|
||||
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
@ -295,7 +286,7 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getResource(string $search = "")
|
||||
public function getResource($search = [])
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
@ -313,56 +304,18 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
//JJO
|
||||
$builder->where("t1.is_deleted", 0);
|
||||
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t1.tipo", $search)
|
||||
->orLike("t1.velocidad", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.ancho_impresion", $search)
|
||||
->orLike("t1.alto_impresion", $search)
|
||||
->orLike("t1.alto_click", $search)
|
||||
->orLike("t1.min", $search)
|
||||
->orLike("t1.max", $search)
|
||||
->orLike("t1.duracion_jornada", $search)
|
||||
->orLike("t1.orden_planning", $search)
|
||||
->orLike("t1.precio_tinta_negro", $search)
|
||||
->orLike("t1.precio_tinta_color", $search)
|
||||
->orLike("t1.velocidad_corte", $search)
|
||||
->orLike("t1.precio_hora_corte", $search)
|
||||
->orLike("t1.metrosxminuto", $search)
|
||||
->orLike("t1.forzar_num_formas_horizontales_cubierta", $search)
|
||||
->orLike("t1.forzar_num_formas_verticales_cubierta", $search)
|
||||
->orLike("t1.observaciones", $search)
|
||||
->orLike("t2.id", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.nombre", $search)
|
||||
->orLike("t1.tipo", $search)
|
||||
->orLike("t1.velocidad", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.ancho_impresion", $search)
|
||||
->orLike("t1.alto_impresion", $search)
|
||||
->orLike("t1.alto_click", $search)
|
||||
->orLike("t1.padre_id", $search)
|
||||
->orLike("t1.min", $search)
|
||||
->orLike("t1.max", $search)
|
||||
->orLike("t1.duracion_jornada", $search)
|
||||
->orLike("t1.orden_planning", $search)
|
||||
->orLike("t1.precio_tinta_negro", $search)
|
||||
->orLike("t1.precio_tinta_color", $search)
|
||||
->orLike("t1.velocidad_corte", $search)
|
||||
->orLike("t1.precio_hora_corte", $search)
|
||||
->orLike("t1.metrosxminuto", $search)
|
||||
->orLike("t1.forzar_num_formas_horizontales_cubierta", $search)
|
||||
->orLike("t1.forzar_num_formas_verticales_cubierta", $search)
|
||||
->orLike("t1.observaciones", $search)
|
||||
->orLike("t2.nombre", $search)
|
||||
->groupEnd();
|
||||
if (empty($search))
|
||||
return $builder;
|
||||
else {
|
||||
$builder->groupStart();
|
||||
foreach ($search as $col_search) {
|
||||
$column = self::SORTABLE[$col_search[0]];
|
||||
$value = $col_search[2];
|
||||
$builder->where("LOWER(CONVERT($column USING utf8)) COLLATE utf8_general_ci LIKE", "%" . strtolower($value) . "%");
|
||||
}
|
||||
$builder->groupEnd();
|
||||
return $builder;
|
||||
}
|
||||
}
|
||||
|
||||
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa , $tirada, $papel_impresion_id = -1)
|
||||
|
||||
Reference in New Issue
Block a user