fix:협업지원금 빈값 저장 시 null 오류 수정

referrer_commission 컬럼이 NOT NULL인데 빈값을 null로 저장하려 해서
Integrity constraint violation 발생. 빈값은 0으로 처리하도록 수정.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-19 17:48:02 +09:00
parent 655d3aba85
commit a4e7740379

View File

@@ -271,7 +271,14 @@ public function updateCommissionDate(int $id, Request $request): JsonResponse
return response()->json(['success' => false, 'message' => '인계 상태일 때만 수당지급일 설정 가능'], 422);
}
$commission->update([$validated['field'] => $validated['value'] ?: null]);
$value = $validated['value'];
if ($validated['field'] === 'referrer_commission') {
$value = (int) ($value ?: 0);
} else {
$value = $value ?: null;
}
$commission->update([$validated['field'] => $value]);
return response()->json(['success' => true]);
}