<?php
/**
+-----------------------------------------------------------------------------------------------------------------------
 * 模型层:用户角色模型类
+-----------------------------------------------------------------------------------------------------------------------
 *
 * PHP version 7
 *
 * @category  App\Models\User
 * @package   App\Models\User
 * @author    Richer <yangzi1028@163.com>
 * @date      2020年4月6日,18:16:17
 * @copyright 2019-2020 Richer (http://www.umu888.com)
 * @license   http://www.umu888.com License
 * @link      http://www.umu888.com
 */
namespace App\Models\User;

use App\Admin\Rewrite\Facades\Admin;
use App\Models\BaseModel;
use Illuminate\Support\Arr;

use Encore\Admin\Auth\Database\Role as Model;

/**
 * Class Role
 *
 * @category App\Models\User
 * @package App\Models\User
 * @author Richer <yangzi1028@163.com>
 * @date 2020年4月6日,18:16:17
 * @copyright 2019-2020 Richer (http://www.umu888.com)
 * @license http://www.umu888.com License
 * @link http://www.umu888.com
 */
class Role extends Model
{
    // 指定数据库表
    const TABLE = 'agency_roles';
    protected $table = self::TABLE;

    // 指定对象显示名称:方便系统统一查询和做其他处理
    const OBJ_NAME      = 'agency-role';
    const OBJ_NAME_ZH   = '角色';

    /**
     * 用户角色
     */
    const GENERAL       = 'general';
    const ENTERPRISE    = 'enterprise';
    const TYPE_OPTIONS = [
        self::GENERAL  => '普通用户',
        self::ENTERPRISE  => '企业用户',
    ];

    /**
     * Create a new Eloquent model instance.
     *
     * @param array $attributes
     */
    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);

        $this->setTable(self::TABLE);
    }
}