add field activo in papel_generico

This commit is contained in:
amazuecos
2025-02-16 23:04:15 +00:00
parent ea8765e708
commit 61fdceb8e1
8 changed files with 65 additions and 16 deletions

View File

@ -22,7 +22,7 @@ class PapelGenericoModel extends \App\Models\BaseModel
4 => "t1.show_in_client_special",
];
protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "show_in_client_special", "deleted_at", "is_deleted"];
protected $allowedFields = ["nombre", "code", "code_ot", "show_in_client", "show_in_client_special", "deleted_at", "is_deleted", "activo"];
protected $returnType = "App\Entities\Configuracion\PapelGenerico";
protected $useTimestamps = true;
@ -120,25 +120,28 @@ class PapelGenericoModel extends \App\Models\BaseModel
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS id, t1.nombre AS nombre, t1.code AS code, t1.code_ot AS code_ot,
t1.show_in_client AS show_in_client, t1.show_in_client_special AS show_in_client_special"
->select("t1.id AS id, t1.nombre AS nombre,
t1.code AS code,
t1.code_ot AS code_ot,
t1.activo AS activo,
t1.show_in_client AS show_in_client,
t1.show_in_client_special AS show_in_client_special"
)
->where("is_deleted", 0);
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.code", $search)
->orLike("t1.code_ot", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.code", $search)
->orLike("t1.code_ot", $search)
->groupEnd();
->groupStart()
->like("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.code", $search)
->orLike("t1.code_ot", $search)
->orLike("t1.id", $search)
->orLike("t1.nombre", $search)
->orLike("t1.code", $search)
->orLike("t1.code_ot", $search)
->groupEnd();
}