diff --git a/Application/Admin/Controller/CompanyStatementLackController.class.php b/Application/Admin/Controller/CompanyStatementLackController.class.php index 28394448f..2924c9b2e 100644 --- a/Application/Admin/Controller/CompanyStatementLackController.class.php +++ b/Application/Admin/Controller/CompanyStatementLackController.class.php @@ -67,13 +67,25 @@ class CompanyStatementLackController extends ThinkController // $this->checkListOrCountAuthRestMap($map);//导出权限 //条件end + if (isset($_REQUEST['export']) && $_REQUEST['export']==1) { + $map['company_type'] = $_REQUEST['export_company_type']; + $data = $this->DBModel + ->field("*") + ->where($map) + ->order("id desc") + ->select(); + $ids = array_column($data, 'id'); + $ids = implode(',', $ids); + $this->export($ids); + return ; + } $data = $this->DBModel ->field("*") ->where($map) ->page($page,$row) ->order("id desc") ->select(); - + foreach($data as $k => &$v) { $v['statement_begin_time'] = date('Y.m.d',$v['statement_begin_time']); @@ -93,7 +105,7 @@ class CompanyStatementLackController extends ThinkController if ($page) { $this->assign('_page', $page); } - + $this->assign('data',$data); $this->assign('count',$count); $this->assign('CompanyType',$this->CompanyType); @@ -265,9 +277,12 @@ class CompanyStatementLackController extends ThinkController )); } - public function export(){ - if(!isset($_REQUEST['ids'])) $this->error("参数错误"); - $ids = $_REQUEST['ids']; + public function export($ids=''){ + if (!$ids) { + if (!isset($_REQUEST['ids'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + } + $dbres = $this->DBModel->where("id in ({$ids})")->select(); $is_export= false; @@ -411,7 +426,8 @@ class CompanyStatementLackController extends ThinkController { $mentBtn = [ "pool"=>"发起汇总", - "export"=>"批量导出" + "export"=>"批量导出", + "export_all"=>"导出所有" ]; $resarr = []; foreach ($mentBtn as $k => $v) { diff --git a/Application/Admin/Controller/SocietyInfoController.class.php b/Application/Admin/Controller/SocietyInfoController.class.php index df90c804e..dddf65b1c 100644 --- a/Application/Admin/Controller/SocietyInfoController.class.php +++ b/Application/Admin/Controller/SocietyInfoController.class.php @@ -274,6 +274,11 @@ class SocietyInfoController extends ThinkController } if ($save['province'] == "请选择省份") $save['province'] = ''; if ($save['city'] == "请选择城市") $save['city'] = ''; + foreach ($save['game_types'] as $v) { + $save['game_type'] .= $v . "/"; + } + $save['game_type'] = trim($save['game_type'], '/'); + $save['create_time'] = time(); $save['update_time'] = time(); $save['communication_time'] = time(); diff --git a/Application/Admin/View/CompanyStatementLack/lists.html b/Application/Admin/View/CompanyStatementLack/lists.html index 21152b647..d64af316f 100644 --- a/Application/Admin/View/CompanyStatementLack/lists.html +++ b/Application/Admin/View/CompanyStatementLack/lists.html @@ -347,9 +347,46 @@ }); }) - + $("#export_all").click(function() { + var start = $("#time_start").val(); + var end = $("#time_end").val(); + if(start !='' && end != ''){ + if (Date.parse(start) > Date.parse(end)){ + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + } + + var url = $('#search').attr('url'); + var query = $('.jssearch').find('input').serialize(); + query += "&"+$('.jssearch').find('select').serialize(); + query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,''); + query = query.replace(/^&/g,''); + if( url.indexOf('?')>0 ){ + url += '&' + query; + }else{ + url += '?' + query; + } + + if ($("#company_type").val()) { + url += "&export=1&export_company_type=" + $("#company_type").val(); + var iframeExcel = ""; + $("body").append(iframeExcel); + return ; + } + url += "&export=1&export_company_type=1"; + var iframeExcel1 = ""; + $("body").append(iframeExcel1); + + url += "&export=1&export_company_type=2"; + var iframeExcel2 = ""; + $("body").append(iframeExcel2); + url += "&export=1&export_company_type=3"; + var iframeExcel3 = ""; + $("body").append(iframeExcel3); + }); $("#search").click(function(){ diff --git a/Application/Payment/Controller/ExcelPaymentController.class.php b/Application/Payment/Controller/ExcelPaymentController.class.php index 67571effc..639ea1a36 100644 --- a/Application/Payment/Controller/ExcelPaymentController.class.php +++ b/Application/Payment/Controller/ExcelPaymentController.class.php @@ -82,7 +82,19 @@ class ExcelPaymentController extends BaseController if(isset($_REQUEST['batch_num'])){ $map['i.batch_num'] = ["LIKE","%{$_REQUEST['batch_num']}%"]; } - + + if (isset($_REQUEST['export']) && $_REQUEST['export']==1) { + $data = M("excel_statement_info","tab_") + ->alias('i') + ->field("i.*") + ->where($map) + ->order("FIELD(pay_status,0,-1,1)") + ->select(); + $ids = array_column($data, 'id'); + $ids = implode(',', $ids); + $this->viewPool($ids); + return ; + } $CompanyInfo = M("excel_statement_info","tab_") ->alias('i') ->field("i.*") @@ -200,12 +212,12 @@ class ExcelPaymentController extends BaseController $this->ajaxReturn(["status"=>1,"msg"=>"ok"]); } //查看 - public function viewPool() + public function viewPool($id) { - if(!isset($_REQUEST['id'])){ - $this->error('参数错误'); + if (!$id) { + if (!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; } - $id = $_REQUEST['id']; $is_export= false; if (isset($_REQUEST['export']) && $_REQUEST['export']==1){ $is_export = true; diff --git a/Application/Payment/Controller/PaymentController.class.php b/Application/Payment/Controller/PaymentController.class.php index 04d7237b0..3ebe4ee80 100644 --- a/Application/Payment/Controller/PaymentController.class.php +++ b/Application/Payment/Controller/PaymentController.class.php @@ -92,6 +92,21 @@ class PaymentController extends BaseController $map['s.pay_type'] = $_REQUEST['pay_type']; } + if (isset($_REQUEST['export']) && $_REQUEST['export']==1) { + $map['s.company_type'] = $_REQUEST['export_company_type']; + $data = M("company_statement_info","tab_") + ->alias('s') + ->field("s.*,p.statement_num statement_pool_num") + ->join("left join tab_company_statement_pool p ON p.id = s.pool_id") + ->where($map) + ->order("FIELD(s.pay_status,0,-1,1),s.verify_status desc") + ->select(); + $ids = array_column($data, 'id'); + $ids = implode(',', $ids); + $this->export($ids); + return ; + } + // dump($map);die(); $sum = M("pay_statement_info","tab_") ->alias('c') @@ -231,12 +246,12 @@ class PaymentController extends BaseController } //导出 - public function export() { + public function export($id) { - if(!isset($_REQUEST['id'])){ - $this->error('参数错误'); + if (!$id) { + if (!isset($_REQUEST['id'])) $this->error("参数错误"); + $id = $_REQUEST['id']; } - $id = $_REQUEST['id']; $data = M("company_statement_info","tab_") ->alias('s') ->field("s.*,p.statement_num statement_pool_num") diff --git a/Application/Payment/View/ExcelPayment/lists.html b/Application/Payment/View/ExcelPayment/lists.html index 0efcb24b1..f639eb3e3 100644 --- a/Application/Payment/View/ExcelPayment/lists.html +++ b/Application/Payment/View/ExcelPayment/lists.html @@ -187,7 +187,8 @@ 打款 Excel导入 - 导出 + 批量导出 + 导出所有 @@ -550,6 +551,35 @@ $("body").append(iframeExcel); } }) + + $("#export_all").click(function() { + var start = $("#time_start").val(); + var end = $("#time_end").val(); + if(start !='' && end != ''){ + if (Date.parse(start) > Date.parse(end)){ + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + } + + var url = $('#search').attr('url'); + var query = $('.jssearch').find('input').serialize(); + query += "&"+$('.jssearch').find('select').serialize(); + query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,''); + query = query.replace(/^&/g,''); + if( url.indexOf('?')>0 ){ + url += '&' + query; + }else{ + url += '?' + query; + } + + url += "&export=1&exporttype=all"; + layer.alert(""+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ ""); + var iframeExcel = ""; + $("body").append(iframeExcel); + + }); + $("#delItem").on("click",function(){ var flag = false; var text = $("input:checkbox[name='ids[]']:checked").map(function(index,elem) { diff --git a/Application/Payment/View/Payment/lists.html b/Application/Payment/View/Payment/lists.html index b6bccb2ef..e5b8fce97 100644 --- a/Application/Payment/View/Payment/lists.html +++ b/Application/Payment/View/Payment/lists.html @@ -219,7 +219,8 @@ 打款信息确认 打款信息确认撤回 - 导出 + 批量导出 + 导出所有 @@ -620,6 +621,33 @@ } }); + $("#export_all").click(function() { + var start = $("#time_start").val(); + var end = $("#time_end").val(); + if(start !='' && end != ''){ + if (Date.parse(start) > Date.parse(end)){ + layer.msg('开始时间必须小于等于结束时间'); + return false; + } + } + + var url = $('#search').attr('url'); + var query = $('.jssearch').find('input').serialize(); + query += "&"+$('.jssearch').find('select').serialize(); + query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,''); + query = query.replace(/^&/g,''); + if( url.indexOf('?')>0 ){ + url += '&' + query; + }else{ + url += '?' + query; + } + + url += "&export=1&export_company_type=" + $("#company_type").val(); + layer.alert(""+"指令执行成功,等待浏览器响应中..在未确认下载完成前请勿关闭此页面.."+ ""); + var iframeExcel = ""; + $("body").append(iframeExcel); + }); + var company_id = "{$_GET['company_id']??0}"; $("#company_type").on("change",function(){ var val = $(this).find("option:selected").val();