<?php
/**
 * Created by PhpStorm.
 * User: sunil
 * Date: 9/4/18
 * Time: 6:22 PM
 */

namespace App;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class MerchantOffersLock extends Model
{

    use SoftDeletes;

    protected $table = 'merchant_offers_lock';

    protected $fillable = ['merchant_id', 'offer_id', 'category_id', 'slug', 'interest_type_id', 'processing_fee', 'tenure', 'advance_emi', 'interest_rate', 'subvention', 'advance_type', 'processing_fee_type','is_deleted','subvention_type_id','created_by','checked_by','status','reason'];

    public function merchant()
    {
        return $this->hasOne('App\Merchant','id','merchant_id');
    }

    public function user(){
        return $this->hasOne('App\User','id','archived_by')->select(['id','name']);
    }
}
