Introduces the subvendedor_id field to the tarifa_promos table and updates the TarifaPromo model accordingly. Refactors tarifas and promociones management in ShowTarifas and ShowUsuarios Livewire components, including utility calculation, validation, and UI improvements for managing both regular and promo tarifas.
31 lines
552 B
PHP
Executable File
31 lines
552 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TarifaPromo extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'utilidad',
|
|
'promocion_id',
|
|
'rol_id',
|
|
'precio',
|
|
'visible',
|
|
'subvendedor_id',
|
|
];
|
|
|
|
public function rol()
|
|
{
|
|
return $this->belongsTo(Role::class, 'rol_id');
|
|
}
|
|
|
|
public function promocion()
|
|
{
|
|
return $this->belongsTo(Promociones::class, 'promocion_id');
|
|
}
|
|
}
|