mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
copiada la rama presu_cliente_v2 en esta para poder hacer el merge al main
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class PapelFormatoModel extends \App\Models\BaseModel
|
||||
@ -72,25 +73,64 @@ class PapelFormatoModel extends \App\Models\BaseModel
|
||||
return empty($search)
|
||||
? $builder
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->groupEnd();
|
||||
->groupStart()
|
||||
->like("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->orLike("t1.id", $search)
|
||||
->orLike("t1.ancho", $search)
|
||||
->orLike("t1.alto", $search)
|
||||
->orLike("t1.created_at", $search)
|
||||
->orLike("t1.updated_at", $search)
|
||||
->groupEnd();
|
||||
}
|
||||
|
||||
public function getElementsForMenu(){
|
||||
public function getElementsForMenu()
|
||||
{
|
||||
return $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS tamanio"
|
||||
)->where('is_deleted', 0)->orderBy('orden_select', 'asc')->get()->getResultObject();
|
||||
}
|
||||
|
||||
public function getElementsForMenu2($search = "")
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS name"
|
||||
)
|
||||
->where('is_deleted', 0)
|
||||
->where('id>', 0)
|
||||
->orderBy('orden_select', 'asc');
|
||||
|
||||
|
||||
return empty($search)
|
||||
? $builder->get()->getResultObject()
|
||||
: $builder
|
||||
->groupStart()
|
||||
->like('t1.ancho', $search)
|
||||
->orLike('t1.alto', $search)
|
||||
->groupEnd()->get()->getResultObject();
|
||||
}
|
||||
|
||||
|
||||
public function getNombre($id = -1)
|
||||
{
|
||||
try {
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"CONCAT(t1.ancho, ' x ', t1.alto) AS name"
|
||||
)
|
||||
->where('t1.id', $id);
|
||||
|
||||
return $builder->get()->getResultObject()[0]->name;
|
||||
} catch (\Exception $e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user