diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Model/UserModel.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Model/UserModel.php b/app/Model/UserModel.php index af49ce7d..c44fd3e7 100644 --- a/app/Model/UserModel.php +++ b/app/Model/UserModel.php @@ -286,7 +286,11 @@ class UserModel extends Base */ public function disable($user_id) { - return $this->db->table(self::TABLE)->eq('id', $user_id)->update(array('is_active' => 0)); + $this->db->startTransaction(); + $result1 = $this->db->table(self::TABLE)->eq('id', $user_id)->update(array('is_active' => 0)); + $result2 = $this->db->table(ProjectModel::TABLE)->eq('is_private', 1)->eq('owner_id', $user_id)->update(array('is_active' => 0)); + $this->db->closeTransaction(); + return $result1 && $result2; } /** |