我想根据Laravel视图刀片中的三个条件过滤结果。我写了这段代码,但没有给我正确的结果,因为我的第二个条件必须在两个数字之间。我的代码:
@foreach($post_array[$key] as $array)
@if($array['diff'] <= 168)
<td>{{ $count }}<td>
@elseif($array['diff'] > (168) && (720))
<td>{{ $count }}<td>
@elseif($array['diff'] > 720)
<td>{{ $count }}<td>
@endif
@endforeach
答案 0 :(得分:1)
@foreach($post_array[$key] as $array)
@if($array['diff'] <= 168)
<td>{{ $count }}<td>
@elseif(($array['diff'] > 168) && ($array['diff'] < 720))
<td>{{ $count }}<td>
@elseif($array['diff'] > 720)
<td>{{ $count }}<td>
@endif
@endforeach