Añadido CRUD para formas de pago

This commit is contained in:
imnavajas
2024-07-31 22:18:53 +02:00
parent 17aa1cf51e
commit 3f1165f323
18 changed files with 239 additions and 268 deletions

View File

@ -15,8 +15,6 @@ class FormaPagoModel extends \App\Models\BaseModel
const SORTABLE = [
1 => "t1.id",
2 => "t1.nombre",
3 => "t1.created_at",
4 => "t1.updated_at",
];
protected $allowedFields = ["nombre"];
@ -26,15 +24,15 @@ class FormaPagoModel extends \App\Models\BaseModel
protected $validationRules = [
"nombre" => [
"label" => "FormasPagoes.nombre",
"label" => "FormasPago.nombre",
"rules" => "trim|required|max_length[255]",
],
];
protected $validationMessages = [
"nombre" => [
"max_length" => "FormasPagoes.validation.nombre.max_length",
"required" => "FormasPagoes.validation.nombre.required",
"max_length" => "FormasPago.validation.nombre.max_length",
"required" => "FormasPago.validation.nombre.required",
],
];
@ -61,7 +59,7 @@ class FormaPagoModel extends \App\Models\BaseModel
{
$builder = $this->db
->table($this->table . " t1")
->select("t1.id AS id, t1.nombre AS nombre, t1.created_at AS created_at, t1.updated_at AS updated_at");
->select("t1.id AS id, t1.nombre AS nombre");
return empty($search)
? $builder
@ -69,12 +67,6 @@ class FormaPagoModel extends \App\Models\BaseModel
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.created_at", $search)
->orLike("t1.updated_at", $search)
->groupEnd();
}
}