You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
611 B
30 lines
611 B
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Site extends Model
|
|
{
|
|
public $timestamps = false;
|
|
|
|
public function user_template()
|
|
{
|
|
return $this->belongsTo('App\SpUserTemplate', 'sp_user_template_id');
|
|
}
|
|
|
|
public function site_config()
|
|
{
|
|
return $this->hasOne('App\SiteConfig');
|
|
}
|
|
|
|
public function getSiteConfigDefaultOtherAttribute()
|
|
{
|
|
if (isset($this->site_config->other)) {
|
|
return $this->site_config->other;
|
|
} else {
|
|
return \App\SiteConfig::whereNull('other')->first()->other;
|
|
}
|
|
}
|
|
}
|