mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 编辑用户添加更新时间
This commit is contained in:
parent
6d3c3dc04a
commit
1f48f13b6c
@ -167,7 +167,8 @@ class User extends Base {
|
||||
$status = $this->request->get('status');
|
||||
$res = ApiUser::update([
|
||||
'id' => $id,
|
||||
'status' => $status
|
||||
'status' => $status,
|
||||
'updateTime' => time()
|
||||
]);
|
||||
if ($res === false) {
|
||||
return $this->buildFailed(ReturnCode::DB_SAVE_ERROR, '操作失败');
|
||||
@ -195,19 +196,20 @@ class User extends Base {
|
||||
if ($postData['groupId']) {
|
||||
$groups = trim(implode(',', $postData['groupId']), ',');
|
||||
}
|
||||
$postData['updateTime'] = time();
|
||||
unset($postData['groupId']);
|
||||
$res = ApiUser::update($postData);
|
||||
if ($res === false) {
|
||||
return $this->buildFailed(ReturnCode::DB_SAVE_ERROR, '操作失败');
|
||||
} else {
|
||||
$has = ApiAuthGroupAccess::get(['uid' => $postData['id']]);
|
||||
if($has){
|
||||
if ($has) {
|
||||
ApiAuthGroupAccess::update([
|
||||
'groupId' => $groups
|
||||
], [
|
||||
'uid' => $postData['id'],
|
||||
]);
|
||||
}else{
|
||||
} else {
|
||||
ApiAuthGroupAccess::create([
|
||||
'uid' => $postData['id'],
|
||||
'groupId' => $groups
|
||||
|
Loading…
x
Reference in New Issue
Block a user