优化表格导出操作
This commit is contained in:
parent
cd947edea3
commit
6f95057f3d
@ -104,7 +104,7 @@ class Index extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
$ct_sql= Db::name('CustomerTrace')->order('id desc')->buildSql();
|
||||
$ct_sql= Db::name('CustomerTrace')->order('id desc')->limit(1)->buildSql();
|
||||
$orderby = 'a.create_time desc';
|
||||
if(isset($param['orderby'])){
|
||||
$orderby = 'ct.'.$param['orderby'];
|
||||
@ -122,7 +122,6 @@ class Index extends BaseController
|
||||
->join('department d', 'a.belong_did = d.id')
|
||||
->join($ct_sql.' ct', 'ct.cid = a.id','left')
|
||||
->order($orderby)
|
||||
->group('a.id') //去重
|
||||
->paginate($rows, false, ['query' => $param])
|
||||
->each(function ($item, $key) {
|
||||
$item->belong_name = Db::name('Admin')->where(['id' => $item->belong_uid])->value('name');
|
||||
|
@ -56,6 +56,9 @@ layui.define(['jquery','layer','table'], function(exports) {
|
||||
let excel_limit = params.excel_limit||1000;
|
||||
if(is_excel){
|
||||
let toolbar = ['filter', {title:'导出EXCEL',layEvent: 'LAYTABLE_EXCEL',icon: 'layui-icon-export'}];
|
||||
if(!params.toolbar){
|
||||
params.toolbar = true;
|
||||
}
|
||||
if(!params.defaultToolbar){
|
||||
params.defaultToolbar = toolbar;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user