【发布时间】:2021-08-21 03:23:19
【问题描述】:
我想显示来自 tbl_structure 的数据和来自 tble_peple 的人名,但我不知道如何加入它。我是 laravel 的新手。
我在控制器上的代码
public function get_people(){
$Showstructe= DB::table('tbl_structure')->orderby("name","asc")
->get();
return view('admin.TestCustomer.structure_show',compact('Showstructe'));
}
我的代码来显示数据
<table class="table table-bordered">
<tr>
<th>ID</th>
<th>Structure</th>
<th>Stage A</th>
<th>Stage B</th>
<th>Stage C</th>
<th>Stage D</th>
<th>Stage E</th>
<th>Stage F</th>
</tr>
@foreach($Showstructe as $people)
<tr>
<td>{{ $people->id }}</td>
<td>{{ $people->name }}</td>
<td>{{ $people->stage_a }}</td>
<td>{{ $people->stage_b }}</td>
<td>{{ $people->stage_c }}</td>
<td>{{ $people->stage_d }}</td>
<td>{{ $people->stage_e }}</td>
<td>{{ $people->stage_f }}</td>
<tr>
@endforeach
</table>
如何显示人名而不仅仅是人名?
【问题讨论】:
标签: laravel-7