where('id', $uid)->first(\App\Models\User::$commonFields); if (!$user) { stderr("Error", "Invalid uid: $uid"); } if ($uid != $CURUSER['id']) { user_can(\App\Enums\Permission\PermissionEnum::VIEW_USER_HISTORY->value, true, $CURUSER['id']); } $isRecordSeedingBonusLog = \App\Models\Setting::getIsRecordSeedingBonusLog(); $defaultCategory = \App\Models\BonusLogs::CATEGORY_COMMON; $category = $_REQUEST['category'] ?? $defaultCategory; $categoryOptions = \App\Models\BonusLogs::listCategoryOptions($isRecordSeedingBonusLog); if (!isset($categoryOptions[$category])) { stderr("Error", "Invalid category: $category"); } $businessType = $_REQUEST['business_type'] ?? 0; $businessTypeOptions = \App\Models\BonusLogs::listBusinessTypeOptions($isRecordSeedingBonusLog ? '' : $defaultCategory); if ($businessType && !isset($businessTypeOptions[$businessType])) { stderr("Error", "Invalid business_type: $businessType"); } stdhead(nexus_trans('bonus-log.title_for_user')); $pagerParam = "?uid=$uid&category=$category&business_type=$businessType"; print("
| ".nexus_trans('bonus-log.fields.business_type')." | ".nexus_trans('bonus-log.fields.old_total_value')." | ".nexus_trans('bonus-log.fields.value')." | ".nexus_trans('bonus-log.fields.new_total_value')." | ".nexus_trans('label.comment')." | ".nexus_trans('label.created_at')." |
| " . $row->businessTypeText . " | " . ($row->old_total_value > 0 ? number_format($row->old_total_value, 1) : '-') . " | " . ($row->old_total_value < $row->new_total_value ? "+" . number_format($row->value, 1) : "-" . number_format($row->value, 1)) . " | " . ($row->new_total_value > 0 ? number_format($row->new_total_value, 1) : '-') . " | " . $row->comment . " | " . $row->created_at . " |