trabajando en servicios encuadernacion

This commit is contained in:
2023-11-20 21:11:20 +01:00
parent d7fda0e8db
commit 58af5bf90f
12 changed files with 114 additions and 1318 deletions

View File

@ -45,6 +45,21 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
];
public function initPresupuesto($tipoPresupuesto, $solapas){
$model = model('App\Models\Presupuestos\TipoPresupuestoTarifaEncuadernacionModel');
$tarifas_ids = $model->get_tarifas($tipo_presupuesto,$solapas);
}
public function delete($presupuesto_id){
$builder = $this->db
->table($this->table . " t1")
->where('t1.presupuesto_id', $presupuesto_id)
->delete();
}
/**
* Get resource data.
*

View File

@ -211,7 +211,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
protected $validationRulesAdd = [
"autor" => [
"label" => "Presupuestos.autor",
"rules" => "trim|required|max_length[150]",
"rules" => "trim|max_length[150]",
],
"titulo" => [
"label" => "Presupuestos.titulo",

View File

@ -0,0 +1,38 @@
<?php
namespace App\Models\Presupuestos;
class TipoPresupuestoTarifaEncuadernacionModel extends \App\Models\GoBaseModel
{
protected $table = "tipos_presupuestos_tarifas_encuadernacion";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
protected $allowedFields = ["tipo_presupuesto_id", "tarifa_encuadernacion_id", "solapas", "is_deleted"];
protected $returnType = "App\Entities\Presupuestos\TipoPresupuestoTarifaEncuadernacionEntity";
protected $useTimestamps = true;
protected $useSoftDeletes = false;
protected $createdField = "created_at";
protected $updatedField = "updated_at";
public static $labelField = "tipo_presupuesto_id";
public function get_tarifas($tipo_presupuesto=-1, $solapas=0){
$where = "t1.solapas IS NULL OR t1.solapas='" . $solapas . "'";
$builder = $this->db
->table($this->table . " t1")
->select("t1.tarifa_encuadernacion_id AS tarifa_encuadernacion_id")
->where("t1.tipo_presupuesto_id", $tipo_presupuesto)
->where($where);
return $builder->get()->getResultArray();
}
}