feat tarifa maquinas

This commit is contained in:
amazuecos
2024-12-24 09:00:56 +01:00
parent 41b4ec5cd3
commit 6790c21675
27 changed files with 863 additions and 46 deletions

View File

@ -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();
}
}