nueva tabla pendientes
This commit is contained in:
+18
-12
@@ -22,27 +22,33 @@ class Historiale extends Model
|
||||
'nombre_cliente'
|
||||
];
|
||||
|
||||
public function vendedor(){
|
||||
return $this ->belongsTo(User::class);
|
||||
public function vendedor()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function tarifa(){
|
||||
return $this ->belongsTo(Tarifas::class);
|
||||
public function tarifa()
|
||||
{
|
||||
return $this->belongsTo(Tarifas::class);
|
||||
}
|
||||
|
||||
public function promocion(){
|
||||
return $this ->belongsTo(Promociones::class);
|
||||
public function promocion()
|
||||
{
|
||||
return $this->belongsTo(Promociones::class);
|
||||
}
|
||||
|
||||
public function cliente(){
|
||||
return $this ->belongsTo(User::class);
|
||||
public function cliente()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function cuentas(){
|
||||
return $this ->belongsToMany(Cuentas::class,'historial_cuentas','historial_id','cuenta_id');
|
||||
public function cuentas()
|
||||
{
|
||||
return $this->belongsToMany(Cuentas::class, 'historial_cuentas', 'historial_id', 'cuenta_id');
|
||||
}
|
||||
|
||||
public function cuentas_obsoletas(){
|
||||
return $this ->belongsToMany(Cuentas::class,'logs','historial_id','cuenta_id');
|
||||
public function cuentas_obsoletas()
|
||||
{
|
||||
return $this->belongsToMany(Cuentas::class, 'logs', 'historial_id', 'cuenta_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Pendientes extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'historial_id',
|
||||
'servicio_id',
|
||||
'cantidad',
|
||||
'estado',
|
||||
];
|
||||
|
||||
public function servicio()
|
||||
{
|
||||
return $this->hasMany(Servicio::class, 'servicio_id');
|
||||
}
|
||||
public function historial()
|
||||
{
|
||||
return $this->hasMany(Historiale::class, 'historial_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user