【发布时间】:2017-10-31 15:44:37
【问题描述】:
我似乎不断收到此错误“Use of undefined constant Yes - assumed 'Yes'”,我不知道为什么?我在网上看了一圈,还是不明白。有人说这是引导错误或其他原因。谁能帮帮我,非常感谢
Home.blade.php
<table class="table table-bordered">
<tr>
<th><strong><big>Name: </big></strong></th>
<th><strong><big>Approval Status: </big></strong></th>
</tr>
<td>
<tr>
@foreach($data as $value)
<tr>
<th><a href="{{route('user.show',['id'=>$value->id])}}">{{$value->Name}}</a></th>
<th>
@foreach($data1 as $value1)
{{$value1->approval_status}}
</th>
</tr>
@endforeach
@endforeach
</tr>
</tr>
</table>
家庭控制器:
public function getData(){
$data['data'] = DB::table('user_infos')->where('deleted_at',NULL)->get()->sortByDesc('created_at');
if(count($data)>0){
return view('home',$data);
}else{
return view('home');
}
public function approval_view(){
$data1 = DB::table('approvals')->where('approval_status',Yes)->get();
return view('home',compact('data1'));
}
【问题讨论】:
-
where('approval_status','Yes')错过了是的报价