haciendo el borrar!

This commit is contained in:
2024-12-02 15:10:26 +01:00
parent 510e33b5fa
commit 9bec8f7adb
7 changed files with 182 additions and 101 deletions

View File

@ -14,14 +14,14 @@ class ClientePreciosModel extends \App\Models\BaseModel
protected $useAutoIncrement = true;
const SORTABLE = [
0 => "t1.tipo",
1 => "t1.tipo_maquina",
2 => "t1.tipo_impresion",
3 => "t1.tiempo_min",
4 => "t1.tiempo_max",
5 => "t1.precio_hora",
6 => "t1.margen",
0 => "t1.id",
1 => "t1.tipo",
2 => "t1.tipo_maquina",
3 => "t1.tipo_impresion",
4 => "t1.tiempo_min",
5 => "t1.tiempo_max",
6 => "t1.precio_hora",
7 => "t1.margen",
];
protected $allowedFields = [
@ -277,10 +277,10 @@ class ClientePreciosModel extends \App\Models\BaseModel
else {
$builder->groupStart();
foreach ($search as $col_search) {
if ($col_search[0] > 2)
$builder->like(self::SORTABLE[$col_search[0]], $col_search[2]);
else
if ($col_search[0] > 0 && $col_search[0] < 4)
$builder->where(self::SORTABLE[$col_search[0]], $col_search[2]);
else
$builder->like(self::SORTABLE[$col_search[0]], $col_search[2]);
}
$builder->groupEnd();
return $builder;