mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
feat tarifa maquinas
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
namespace App\Models\Tarifas\Maquinas;
|
||||
|
||||
use App\Database\Migrations\TarifaExtraMaquinaTable;
|
||||
use App\Entities\Tarifas\Maquinas\TarifaPreimpresionMaquinaEntity;
|
||||
|
||||
use App\Entities\Tarifas\Maquinas\TarifaExtraMaquinaEntity;
|
||||
use CodeIgniter\Database\BaseBuilder;
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class TarifaExtraMaquinaEntity extends Model
|
||||
class TarifaExtraMaquinaModel extends Model
|
||||
{
|
||||
protected $table = 'tarifa_acabado_maquinas';
|
||||
protected $primaryKey = 'id';
|
||||
@ -49,4 +50,27 @@ class TarifaExtraMaquinaEntity extends Model
|
||||
protected $afterFind = [];
|
||||
protected $beforeDelete = [];
|
||||
protected $afterDelete = [];
|
||||
|
||||
/**
|
||||
* Query for datatable
|
||||
*
|
||||
* @param integer|null $tarifa_extra_id
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
public function queryDatatable(?int $tarifa_extra_id = null): BaseBuilder
|
||||
{
|
||||
$query = $this->builder()->select(
|
||||
[
|
||||
"tarifa_extra_maquinas.id",
|
||||
"lg_maquinas.nombre as maquinaNombre",
|
||||
"maquina_tareas.name as tareaNombre"
|
||||
]
|
||||
)->join("lg_maquinas", "lg_maquinas.id = tarifa_extra_maquinas.maquina_id", "left")
|
||||
->join("maquina_tareas", "maquina_tareas.id = tarifa_extra_maquinas.maquina_tarea_id", "left")
|
||||
->where("tarifa_extra_maquinas.deleted_at",null);
|
||||
|
||||
if ($tarifa_extra_id)
|
||||
$query->where("tarifa_extra_maquinas.id", $tarifa_extra_id);
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user