* zin: fix the name and display of thinkradio wg.

This commit is contained in:
wangzemei
2024-05-17 09:39:16 +08:00
parent 4d85de81f0
commit e24effb2a0
+3 -2
View File
@@ -22,6 +22,7 @@ class thinkRadio extends thinkQuestion
$detailWg = parent::buildDetail();
$step = $this->prop('step');
$answer = $step->answer;
$result = isset($answer->result) ? $answer->result : array();
if(!empty($step->options->fields)) $step->options->fields = is_string($step->options->fields) ? explode(', ', $step->options->fields) : array_values((array)$step->options->fields);
$fields = $step->options->fields ?? array();
@@ -33,8 +34,8 @@ class thinkRadio extends thinkQuestion
(
set::type($step->options->questionType),
set::items($items),
set::name($step->options->questionType == 'radio' ? 'result' : 'result[]'),
set::value(isset($answer->result) ? $answer->result : ''),
set::name('result[]'),
set::value($step->options->questionType == 'radio' ? $result[0] : $result),
);
return $detailWg;
}