phpexcel的使用可参考我之前写的教程 Laravel和TP导出数据Excel
# 导入的类
use PHPExcel;
use PHPExcel_IOFactory;
use PHPExcel_Worksheet_Drawing;
/**
* 导出Excel方法
*/
public function export()
{
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
# 整理数据
$this->model
->where($where)
->order($sort, $order);
$list = $this->model->select();
$list = collection($list)->toArray();
$count = count($list); // 总条数
# 填充表头数据
$head = ['身份证号',