Passed
Push — master ( 537546...f6872a )
by Jianhua
06:02 queued 15s
created

AdminUser   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 37
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A comments() 0 3 1
1
<?php
2
/**
3
 * Date: 2019/2/25 Time: 10:34
4
 *
5
 * @author  Eddy <[email protected]>
6
 * @version v1.0.0
7
 */
8
9
namespace App\Model\Admin;
10
11
use Illuminate\Foundation\Auth\User as Authenticatable;
12
use Spatie\Permission\Traits\HasRoles;
13
14
class AdminUser extends Authenticatable
15
{
16
    use HasRoles;
0 ignored issues
show
introduced by
The trait Spatie\Permission\Traits\HasRoles requires some properties which are not provided by App\Model\Admin\AdminUser: $name, $map, $permissions, $roles
Loading history...
17
18
    const STATUS_ENABLE = 1;
19
    const STATUS_DISABLE = 0;
20
21
    protected $guarded = [];
22
23
    protected $guard_name = 'admin';
24
25
    public static $searchField = [
26
        'name' => '用户名',
27
        'status' => [
28
            'showType' => 'select',
29
            'searchType' => '=',
30
            'title' => '状态',
31
            'enums' => [
32
                0 => '禁用',
33
                1 => '启用',
34
            ],
35
        ],
36
        'created_at' => [
37
            'showType' => 'datetime',
38
            'title' => '创建时间'
39
        ]
40
    ];
41
42
    public static $listField = [
43
        'name' => '用户名',
44
        'statusText' => '状态',
45
        'roleNames' => '角色',
46
    ];
47
48
    public function comments()
49
    {
50
        return $this->hasMany('App\Model\Admin\Comment', 'user_id');
51
    }
52
}
53