From 847dbd9c2115d84b72b95cd4b381d79c15edfef8 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Thu, 8 May 2025 06:19:45 +0000 Subject: [PATCH] * [task#143103,done,0.2h] fix bug. --- module/user/model.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/user/model.php b/module/user/model.php index 59ecf85f6e..9893929b71 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -753,7 +753,11 @@ class userModel extends model /* 如果权限组发生变化,则删除原有的权限组,重新创建并更新用户视图。*/ /* If the group changed, delete the old group, create new group and update user view. */ - $this->dao->delete()->from(TABLE_USERGROUP)->where('account')->eq($user->account)->exec(); + $projectGroups = $this->dao->select('id')->from(TABLE_GROUP)->where('project')->ne(0)->fetchPairs(); + $this->dao->delete()->from(TABLE_USERGROUP) + ->where('account')->eq($user->account) + ->andWhere('`group`')->notin($projectGroups) + ->exec(); if($newGroups) $this->createUserGroup($newGroups, $user->account); return !dao::isError();