<?php
/**
* @author 龙虾 <15108148@qq.com>
* @version 2.0 2020-08-04
* @copyright 睿谷信息 <www.rgxx.com>
*/
namespace app\common\model;
use think\Model as Basemodel;

class Domains extends Basemodel
{
	// 自动完成
	protected $insert = ['site_id'];
	protected function setSiteIdAttr()
    {
        return session('siteid');
    }
    public function getIsmainAttr($value,$data)
    {
    	$site_info = $this->site;
    	if($site_info['domain'] == $data['domain']) {
    		return true;
    	} else {
    		return false;
    	}
    }
	// 关联
	public function site()
	{
		return $this->belongsTo('Site');
	}
}