新增部门和岗位

This commit is contained in:
yanwenwu
2020-01-12 09:30:56 +08:00
parent 5ec9939cbf
commit 8b93c63883
11 changed files with 100 additions and 11 deletions

View File

@@ -1,12 +1,14 @@
<?php
namespace catchAdmin\user\model;
use catchAdmin\permissions\model\HasJobsTrait;
use catchAdmin\permissions\model\HasRolesTrait;
use catcher\base\CatchModel;
class Users extends CatchModel
{
use HasRolesTrait;
use HasJobsTrait;
protected $name = 'users';
@@ -15,7 +17,8 @@ class Users extends CatchModel
'username', // 用户名
'password', // 用户密码
'email', // 邮箱 登录
'creator_id',
'creator_id', // 创建者ID
'department_id', // 部门ID
'status', // 用户状态 1 正常 2 禁用
'last_login_ip', // 最后登录IP
'last_login_time', // 最后登录时间
@@ -48,7 +51,7 @@ class Users extends CatchModel
public function getList($search): \think\Paginator
{
return (($search['trash'] ?? false) ? static::onlyTrashed() : $this)
->field(['id', 'username', 'email', 'status','last_login_time','last_login_ip', 'created_at', 'updated_at'])
->field(['id', 'username', 'email', 'status','last_login_time','last_login_ip', 'department_id','created_at', 'updated_at'])
->when($search['username'] ?? false, function ($query) use ($search){
$query->whereLike('username', '%' . $search['username'] . '%');
})