mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
solucionados todos los select2 en conflicto
This commit is contained in:
@ -264,19 +264,9 @@ class Papelformato extends \App\Controllers\BaseResourceController {
|
|||||||
public function getSelect2()
|
public function getSelect2()
|
||||||
{
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
$query = $this->model->builder()->select(
|
$data = $this->model->getElementsForMenu2($this->request->getGet("q"));
|
||||||
[
|
|
||||||
"id",
|
return $this->response->setJSON($data);
|
||||||
"nombre as name"
|
|
||||||
]
|
|
||||||
)->where("deleted_at", null);
|
|
||||||
if ($this->request->getGet("q")) {
|
|
||||||
$query->groupStart()
|
|
||||||
->orLike("clientes.nombre", $this->request->getGet("q"))
|
|
||||||
->groupEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->response->setJSON($query->get()->getResultObject());
|
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,8 +98,12 @@ class PapelFormatoModel extends \App\Models\BaseModel
|
|||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select(
|
->select(
|
||||||
"t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS text"
|
"t1.id AS id, CONCAT(t1.ancho, ' x ', t1.alto) AS name"
|
||||||
)->where('is_deleted', 0)->orderBy('orden_select', 'asc');
|
)
|
||||||
|
->where('is_deleted', 0)
|
||||||
|
->where('id>', 0)
|
||||||
|
->orderBy('orden_select', 'asc');
|
||||||
|
|
||||||
|
|
||||||
return empty($search)
|
return empty($search)
|
||||||
? $builder->get()->getResultObject()
|
? $builder->get()->getResultObject()
|
||||||
|
|||||||
Reference in New Issue
Block a user