Role.php
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?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);
}
}