terminadas plantillas cliente y plantillas cliente lineas

This commit is contained in:
2024-01-02 10:14:45 +01:00
parent 3c9a08a726
commit 17885c29f9
17 changed files with 1123 additions and 451 deletions

View File

@ -6,6 +6,10 @@ class ClientePlantillaPreciosModel extends \App\Models\GoBaseModel
{
protected $table = "cliente_plantilla_precios";
const SORTABLE = [
0 => "t1.nombre",
];
/**
* Whether primary key uses auto increment.
*
@ -40,5 +44,31 @@ class ClientePlantillaPreciosModel extends \App\Models\GoBaseModel
],
];
/**
* Get resource data.
*
* @param string $search
*
* @return \CodeIgniter\Database\BaseBuilder
*/
public function getResource(string $search = "", $cliente_id = -1)
{
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id as id, t1.nombre AS nombre"
);
$builder->where('t1.is_deleted', 0);
return empty($search)
? $builder
: $builder
->groupStart()
->like("t1.nombre", $search)
->groupEnd();
}
}