【发布时间】:2018-07-30 09:33:33
【问题描述】:
所以我有一个函数是:
public function checkTS(Request $request, $companyID)
{
$data = DiraQuestion::where('status', 0)->get();
return view('AltHr.Chatbot.checkTS', compact('data','companyID'));
}
从这里我输出一个表格:
<table id="myTable" class="table table-striped">
<thead>
<tr>
<th></th>
<th>Entity Type</th>
<th>Entity Value</th>
<th>Synonym</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($data as $b)
<tr>
<td><input type="hidden" name="id" value="{{ $b->id }}" readonly></td>
<td>{{ucwords(strtok($b->eType, '_'))}}</td>
<td>{{ucwords($b->eVal)}}</td>
<td>{{ucwords($b->synonym)}}</td>
<td><a href="{{action('AltHr\Chatbot\ChatbotController@viewTS', [$companyID, $b->id, $b->eType, $b->eVal])}}" class="btn alt-btn alt-btn-black">View</a></td>
</tr>
@endforeach
</tbody>
</table>
正如您从第一张图片中看到的那样,我想要做的是将具有相同意图、eType、eVal 的数据库组合在一起,因此与其显示表中的所有值,不如只显示 1 个值,即已经按相同的 3 值组合在一起。我该怎么做?
【问题讨论】:
标签: php html mysql database laravel