mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en servicios encuadernacion
This commit is contained in:
@ -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.
|
||||
*
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user