Issues (40)

app/Model/Admin/AdminUser.php (1 issue)

Severity
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
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