perf: 头像显示部门

This commit is contained in:
kuaifan
2022-11-19 17:41:36 +08:00
parent f963a00a05
commit 558d004e35
3 changed files with 4 additions and 1 deletions

View File

@@ -71,6 +71,7 @@ class UserDelete extends AbstractModel
$cache = $row->cache;
$cache = array_intersect_key($cache, array_flip(User::$basicField));
$cache['delete_at'] = $row->created_at->format($row->dateFormat ?: 'Y-m-d H:i:s');
$cache['department_name'] = $cache['department'] ? UserDepartment::whereIn('id', $cache['department'])->pluck('name')->implode(',') : '';
return $cache;
}
}