目前如何调用句子如下:
控制器:
public function newTest($companyID, $entityType,$q)
{
$db = [];
$dmb = DiraMasterBot::all();
foreach ($dmb AS $datum)
{
if (!isset($db[$datum->description])) $db[$datum->description] = ['intent' => [], 'q1' => [], 'q2' => [], 'q3' => []];
$db[$datum->description]['intent'][$datum->intent] = $datum->id;
if (!isset($db[$datum->description])) $db[$datum->description] = ['intent' => [], 'q1' => [], 'q2' => [], 'q3' => []];
$db[$datum->description]['q1'][$datum->sampleQ1] = $datum->id;
if (!isset($db[$datum->description])) $db[$datum->description] = ['intent' => [], 'q1' => [], 'q2' => [], 'q3' => []];
$db[$datum->description]['q2'][$datum->sampleQ2] = $datum->id;
if (!isset($db[$datum->description])) $db[$datum->description] = ['intent' => [], 'q1' => [], 'q2' => [], 'q3' => []];
$db[$datum->description]['q3'][$datum->sampleQ3] = $datum->id;
}
ksort($db);
// dd($db);
return view('AltHr.Chatbot.newTest', compact('db', 'dmb','entityType','companyID','q'));
}

视图:
@foreach($questionAnswer['q2'] as $question => $questionID)
<table class="question">
<tr>
<td class="labels"><p>User:</p></td>
<td><p> {{$question}}</p></td>
</tr>
</table>
@endforeach
&#13;
答案 0 :(得分:0)
我找到了使用
的答案
mutate_at()
&#13;