<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class DistribucionFichero extends Model
{
    protected $table = 'crm_distribucion_fichero';
    //
    public function socio(){
        return $this->hasOne('App\Socio', 'id', 'id_socio')->with('codigo');
    }
    public function apm(){
        return $this->hasOne('App\Apm', 'id', 'id_apm')->with('linea')->with('gira');
    }
    public function socio_fichero(){
        return $this->hasOne('App\Socio', 'id', 'id_socio')->with('tipoSocio')->with('gira')->with('especialidad')->with('clasificacion');
    }
    public function visita(){
        return $this->hasOne('App\Visita', 'id_distribucion', 'id');
    }
}
