mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminadas plantillas cliente y plantillas cliente lineas
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user