mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Inicializacion del modulo catalogo
This commit is contained in:
109
ci4/app/Models/Catalogo/CatalogoLibroModel.php
Normal file
109
ci4/app/Models/Catalogo/CatalogoLibroModel.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
use App\Entities\Catalogo\CatalogoLibro;
|
||||
|
||||
class CatalogoLibroModel extends Model
|
||||
{
|
||||
protected $table = 'catalogo_libros';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $returnType = CatalogoLibro::class;
|
||||
protected $useSoftDeletes = true;
|
||||
protected $useTimestamps = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
'cliente_id',
|
||||
'proveedor_id',
|
||||
'user_created_id',
|
||||
'user_update_id',
|
||||
'cubierta_archivo',
|
||||
'cubierta_url',
|
||||
'ancho',
|
||||
'alto',
|
||||
'peso',
|
||||
'titulo',
|
||||
'autor',
|
||||
'autor_entidad',
|
||||
'traductor',
|
||||
'ilustrador',
|
||||
'idioma',
|
||||
'num_edic',
|
||||
'fecha_disponibilidad',
|
||||
'fecha_public',
|
||||
'num_fotos',
|
||||
'num_ilustr',
|
||||
'num_ilustr_color',
|
||||
'num_ilustr_bn',
|
||||
'coleccion',
|
||||
'isbn',
|
||||
'ean',
|
||||
'editorial',
|
||||
'resumen',
|
||||
'resumen_breve',
|
||||
'sello',
|
||||
'paginas',
|
||||
'tipo_impresion',
|
||||
'solapas_ancho',
|
||||
'cubiertas_ancho',
|
||||
'comentarios',
|
||||
'negro_paginas',
|
||||
'negro_papel',
|
||||
'negro_gramaje',
|
||||
'color_paginas',
|
||||
'color_papel',
|
||||
'color_gramaje',
|
||||
'portada_paginas',
|
||||
'portada_papel',
|
||||
'portada_gramaje',
|
||||
'portada_acabado',
|
||||
'cubierta_paginas',
|
||||
'cubierta_papel',
|
||||
'cubierta_gramaje',
|
||||
'cubierta_acabado',
|
||||
'encuardenacion',
|
||||
'ubicacion',
|
||||
];
|
||||
|
||||
protected $useAutoIncrement = true;
|
||||
protected $protectFields = true;
|
||||
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Opcional: reglas de validación
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get resource data.
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getDatatableQuery()
|
||||
{
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id,
|
||||
t1.nombre AS nombre,
|
||||
t1.code AS cliente,
|
||||
t1.titulo AS titulo,
|
||||
t1.edicion AS edicion,
|
||||
t1.autor AS autor,
|
||||
t1.isbn AS isbn,
|
||||
t1.ean AS ean,
|
||||
t1.paginas AS paginas,
|
||||
t1.cubierta_url AS portada"
|
||||
);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user