mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat tarifa maquinas
This commit is contained in:
@ -375,4 +375,24 @@ class MaquinaModel extends \App\Models\BaseModel
|
||||
|
||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* Query for select2
|
||||
*
|
||||
* @param string|null $q Query param from select2 ajax request
|
||||
* @param string|null $type Tipo de maquina impresion,manipulado,acabado
|
||||
* @return array
|
||||
*/
|
||||
public function getSelectQuery(?string $q = null, ?string $type = null) : array
|
||||
{
|
||||
$query = $this->builder()->select(["id","nombre","tipo as description"])
|
||||
->where("deleted_at",null);
|
||||
if($q){
|
||||
$query->like("nombre",$q);
|
||||
}
|
||||
if($type){
|
||||
$query->where("tipo",$type);
|
||||
}
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user