<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;

class PartnerCommission extends BaseModel
{
    use HasFactory;

    public $guarded = [];

    public function main_order()
    {
        return $this->belongsTo(Order::class, 'order_id', 'id');
    }

    public function offline_order()
    {
        return $this->belongsTo(OfflineOrder::class,'order_id','order_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function withdrawal()
    {
        return $this->belongsTo(PartnerWithdrawal::class,'withdrawal_id','id');
    }

    public function order_commission(){
        return $this->belongsTo(OrderCommission::class,'order_commission_id','id');
    }
}
