support modify personal attendance card

This commit is contained in:
xiaomlove
2022-05-29 15:19:16 +08:00
parent cf7f2af06e
commit 36a1f83d7d
40 changed files with 289 additions and 48 deletions
+4
View File
@@ -219,6 +219,7 @@ class UserRepository extends BaseRepository
'downloaded' => 'downloaded',
'bonus' => 'seedbonus',
'invites' => 'invites',
'attendance_card' => 'attendance_card',
];
if (!isset($fieldMap[$field])) {
throw new \InvalidArgumentException("Invalid field: $field, only support: " . implode(', ', array_keys($fieldMap)));
@@ -240,6 +241,9 @@ class UserRepository extends BaseRepository
} else {
throw new \InvalidArgumentException("Invalid action: $action.");
}
if ($new < 0) {
throw new NexusException("New value($new) lte 0");
}
//for administrator, use english
$modCommentText = nexus_trans('message.field_value_change_message_body', [
'field' => nexus_trans("user.labels.$sourceField", [], 'en'),