lk.zachem.info/app/Models/Deal/Deal.php
2025-02-05 08:25:10 +08:00

32 lines
706 B
PHP

<?php
namespace App\Models\Deal;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Deal extends Model
{
use HasFactory;
protected $fillable = [
'client_id',
'complex_id',
'agent_id',
'bitrix_id',
'is_unique',
'confirm_token'
];
public function complex()
{
return $this->belongsTo(\App\Models\Complex::class);
}
public function user()
{
return $this->belongsTo(\App\Models\User::class, 'client_id');
}
public function agent()
{
return $this->belongsTo(\App\Models\Agent\Agent::class, 'agent_id');
}
}