+ [task#131071] add logic of the buildResultCard function.

This commit is contained in:
wangzemei
2024-11-01 14:30:59 +08:00
committed by 谢杞钰
parent ac8efba83f
commit 3f24ab9901
+18
View File
@@ -71,6 +71,24 @@ class thinkModel extends wg
protected function buildResultCard(array $steps, int $key, bool $isPosition = false): array
{
$questionList = array();
foreach($steps as $step)
{
if(is_string($step->link)) $step->link = json_decode($step->link, true);
if(is_string($step->answer)) $step->answer = json_decode($step->answer);
if(is_string($step->options)) $step->options = json_decode($step->options);
$resultCard = array();
$className = '';
if($step->link['showMethod'] == 2)
{
$className = "card-{$step->options->questionType}";
$resultCard = $this->buildQuestionItem($step);
}
elseif($step->link['showMethod'] == '1')
{
$resultCard = $this->buildMulticolumnContent($step);
}
}
return $questionList;
}
}