先上效果:
再上代码:
@extends('emails/master_email')
<style type="text/css">
{
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
width:100%;
border-collapse:collapse;
}
{
font-size:1em;
border:1px solid
text-align: left;
}
{
font-size:1.1em;
text-align:left;
background-color:
color:
}
{
color:
background-color:
}
</style>
@section('content')
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-sm-12">
<div class="ibox float-e-margins">
{{-- 表格内容 --}}
<div class="ibox-content">
<table id="customers">
<caption><h2 align="center" style="color: black;">{{$data->range}}注册用户信息表</h2></caption>
<thead>
<tr>
<th>用户名</th>
<th>用户类型</th>
<th>用户邮箱</th>
<th>注册时间</th>
<th>最近一次登陆时间</th>
<th>最近一次学习课程时间</th>
<th>最近一次学习练习时间</th>
</tr>
</thead>
@if (count($data))
{{-- @if ($data->total()>0) --}}
<tbody>
@foreach ($data as $key=>$element)
{{-- 这个key用来判断隔行换色 --}}
<tr class="{{ ($key%2==1)?'alt':'' }}">
<td>{{$element->user_name}}</td>
<td>{{$element->customer_type}}</td>
<td>{{$element->email}}</td>
<td>{{$element->create_time}}</td>
<td>{{$element->loginInTokens[0]->login_time or '未登录'}}</td>
<td>{{$element->lessonRecords[0]->update_time or '未学习'}}</td>
<td>{{$element->exerciseRecords[0]->update_time or '未学习'}}</td>
</tr>
@endforeach
</tbody>
</table>
@else
<tbody>
<tr ><td colspan="7"><div><h3 align="center">近一周没有注册用户,我们需要继续努力啊!</h3></div></td></tr>
</tbody>
</table>
@endif
</div>
</div>
</div>
</div>
@endsection