修复无法正常删除部门成员的问题

Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
vilson 2019-01-26 22:04:21 +08:00
parent 2d1f668f72
commit c6c58b580a

View File

@ -81,10 +81,9 @@ class DepartmentMember extends CommonModel
}
$result = $hasJoined->delete();
$department_codes = self::where(['account_code' => $accountCode, 'organization_code' => $orgCode])->column('department_code');
if ($department_codes) {
$department_codes = implode(',', $department_codes);
MemberAccount::update(['department_code' => $department_codes], ['code' => $accountCode]);
}
!$department_codes && $department_codes = [];
$department_codes = implode(',', $department_codes);
MemberAccount::update(['department_code' => $department_codes], ['code' => $accountCode]);
return $result;
}
}