From 200c38cb29032f443e8e61bb846903eb851d7103 Mon Sep 17 00:00:00 2001 From: ale Date: Mon, 23 Jun 2025 20:44:51 -0300 Subject: [PATCH] Agregada columna y campo cantidad_ollas --- app/Subpedido.php | 10 +++++- ...25_06_23_233548_cantidad_ollas_pedidos.php | 32 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2025_06_23_233548_cantidad_ollas_pedidos.php diff --git a/app/Subpedido.php b/app/Subpedido.php index 6faad84..378b832 100644 --- a/app/Subpedido.php +++ b/app/Subpedido.php @@ -12,7 +12,15 @@ use App\Filtros\FiltroDeSubpedido; class Subpedido extends Model { - protected $fillable = ['grupo_de_compra_id', 'aprobado', 'nombre', 'devoluciones_total', 'devoluciones_notas', 'tipo_pedido_id']; + protected $fillable = [ + 'grupo_de_compra_id', + 'aprobado', + 'nombre', + 'devoluciones_total', + 'devoluciones_notas', + 'tipo_pedido_id', + 'cantidad_ollas' + ]; public function productos(): BelongsToMany { diff --git a/database/migrations/2025_06_23_233548_cantidad_ollas_pedidos.php b/database/migrations/2025_06_23_233548_cantidad_ollas_pedidos.php new file mode 100644 index 0000000..3ae2bd0 --- /dev/null +++ b/database/migrations/2025_06_23_233548_cantidad_ollas_pedidos.php @@ -0,0 +1,32 @@ +integer('cantidad_ollas')->nullable(); + }); + Subpedido::where('tipo_pedido', 1)->update(['cantidad_ollas' => 0]); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}