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:
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TareaMaquinaEntity;
|
||||
use CodeIgniter\Model;
|
||||
@ -14,7 +14,7 @@ class MaquinaTareaModel extends Model
|
||||
protected $useSoftDeletes = true;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [
|
||||
"nombre",
|
||||
"name",
|
||||
"description",
|
||||
];
|
||||
|
||||
@ -47,4 +47,22 @@ class MaquinaTareaModel extends Model
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for select2
|
||||
*
|
||||
* @param string|null $q Query param from select2 ajax request
|
||||
* @return array
|
||||
*
|
||||
*/
|
||||
public function getSelectQuery(?string $q = null) : array
|
||||
{
|
||||
$query = $this->builder()->select(["id","name","description"])
|
||||
->where("deleted_at",null);
|
||||
if($q){
|
||||
$query->like("nombre",$q);
|
||||
}
|
||||
|
||||
return $query->get()->getResultArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user