<?php

namespace App\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Slowlyo\OwlAdmin\Models\BaseModel as Model;

/**
 * 店铺
 */
class ShopInfo extends Model
{
	use SoftDeletes;

	protected $table = 'shop_infos';

    /**
     * @Author FelixYin
     * @description 店铺所属会员
     */
    public function member()
    {
        return $this->belongsTo('App\Models\MemberUser', 'user_id');
    }

    /**
     * @Author FelixYin
     * @description 店铺关联认证信息
     */
    public function auth()
    {
        return $this->hasOne('App\Models\ShopAuthRecord', 'id', 'auth_record_id');
    }

    /**
     * @Author FelixYin
     * @description 店铺关联技师
     */
    public function coaches()
    {
        return $this->hasMany('App\Models\CoachUser', 'shop_id', 'id');
    }

    /**
     * @Author FelixYin
     * @description 店铺关联服务
     */
    public function services()
    {
        return $this->hasMany('App\Models\ShopService', 'shop_id', 'id');
    }

    /**
     * @Author FelixYin
     * @description 店铺关联认证记录
     */
    public function authRecords()
    {
        return $this->hasMany('App\Models\ShopAuthRecord', 'shop_id', 'id');
    }
}