FHM09062601IBL - simpan T_ScreeningAnswerValue sebagai JSON object bukan string
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -530,8 +530,13 @@ class Screening extends MY_Controller
|
|||||||
$form_id = intval($item['M_ScreeningFormID'] ?? 0);
|
$form_id = intval($item['M_ScreeningFormID'] ?? 0);
|
||||||
if (!$form_id) continue;
|
if (!$form_id) continue;
|
||||||
|
|
||||||
// Simpan label sebagai JSON string agar json_decode di search() bekerja
|
// Simpan sebagai JSON object
|
||||||
$stored_value = json_encode($item['answer_label'] ?? '');
|
$answer_type = $item['answer_type'] ?? 'single';
|
||||||
|
if ($answer_type === 'text') {
|
||||||
|
$stored_value = json_encode(['value' => $item['answer_label'] ?? '']);
|
||||||
|
} else {
|
||||||
|
$stored_value = json_encode(['id' => $item['answer_id'] ?? '', 'label' => $item['answer_label'] ?? '']);
|
||||||
|
}
|
||||||
|
|
||||||
$this->db_oneklinik->query(
|
$this->db_oneklinik->query(
|
||||||
"INSERT INTO one_klinik.t_screening_answer
|
"INSERT INTO one_klinik.t_screening_answer
|
||||||
|
|||||||
Reference in New Issue
Block a user