From 9ca131aaaace403c738937c0ab99eaf408013085 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 12 Feb 2020 16:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A8=E5=BB=A3=E5=93=A1bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/DownloadController.class.php | 23 ++++++++++++++----- .../Controller/FinanceController.class.php | 9 +++++--- .../Home/View/default/Promote/addPromote.html | 9 ++++++-- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index 8bdcee62e..0e9d55563 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -3066,7 +3066,7 @@ class DownloadController extends BaseController { $pages = ceil($accessNum / $perSize); for($i = 1; $i <= $pages; $i++) { - $data = $model->field('pay_order_number,game_name,user_account,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') + $data = $model->field('pay_order_number,game_name,user_account,promote_id,promote_account,pay_amount,pay_way,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_time,selle_status,pay_status,withdraw_id') ->where($map) ->order('id desc') ->limit(($i-1)*$perSize ,$perSize) @@ -3084,6 +3084,14 @@ class DownloadController extends BaseController { ->where(array('id' => ['in',$withdrawIds])) ->getField('id,status'); + $promotes = []; + $promoteService = new PromoteService(); + if (count($data) > 0) { + $promoteIds = array_column($data, 'promote_id'); + $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); + $promotes = index_by_column('id', $promotes); + } + foreach ($data as &$list) { //提现状态 $list['pay_order_number'] = $this->encryption($list['pay_order_number']); @@ -3115,11 +3123,12 @@ class DownloadController extends BaseController { $list['pay_amount_nei'] = 0; } + $promoteGroup = isset($promotes[$list['promote_id']]) ? $promoteService->getGroupNameByChain($promotes[$list['promote_id']]['chain'], $list['promote_id']) : ''; $csvData["pay_order_number"] = $list["pay_order_number"]; $csvData["game_name"] = $list["game_name"]; $csvData["user_account"] = $list["user_account"]; - $csvData["promote_account"] = $list["promote_account"]; + $csvData["promote_account"] = $list["promote_account"] . ($promoteGroup == '' ? '' : '(' . $promoteGroup . ')'); $csvData["pay_amount"] = $list["pay_amount"]; $csvData["pay_amount_zhi"] = $list["pay_amount_zhi"]; $csvData["pay_amount_nei"] = $list["pay_amount_nei"]; @@ -3620,10 +3629,12 @@ class DownloadController extends BaseController { ->limit(($i-1)*$perSize ,$perSize) ->select(); - $promoteService = new PromoteService(); - $promoteIds = array_column($data, 'promote_id'); - $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); - $promotes = index_by_column('id', $promotes); + if (count($data) > 0) { + $promoteService = new PromoteService(); + $promoteIds = array_column($data, 'promote_id'); + $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); + $promotes = index_by_column('id', $promotes); + } foreach($data as $key => $value) { // if (empty($value['user_account']) ) { diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 9fb427ce0..06e4ca0f5 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -293,10 +293,13 @@ class FinanceController extends BaseController ->where(array('id' => ['in', $withdrawIds])) ->getField('id,status'); + $promotes = []; $promoteService = new PromoteService(); - $promoteIds = array_column($data, 'promote_id'); - $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); - $promotes = index_by_column('id', $promotes); + if (count($data) > 0) { + $promoteIds = array_column($data, 'promote_id'); + $promotes = M('promote', 'tab_')->field(['id', 'chain', 'account'])->where(['id' => ['in', $promoteIds]])->select(); + $promotes = index_by_column('id', $promotes); + } foreach ($data as &$list) { //提现状态 diff --git a/Application/Home/View/default/Promote/addPromote.html b/Application/Home/View/default/Promote/addPromote.html index d3c259252..5ddf5a138 100644 --- a/Application/Home/View/default/Promote/addPromote.html +++ b/Application/Home/View/default/Promote/addPromote.html @@ -121,11 +121,14 @@ var promote_type = $('[name=promote_type]').val(); var repassword = $('#repassword').val(); var parent_id = $('#parent_id').val(); + var group_remark = $('#group_remark').val(); + if (group_remark === undefined) { + group_remark = ''; + } if ($('#parent_id').length > 0 && parent_id == 0) { layer.msg('请选择所属上级'); return } - console.log(promote_type) $.ajax({ type:"POST", url:"{:U('addPromote')}", @@ -139,6 +142,7 @@ mobile_phone: mobile_phone, idcard: idcard, nickname: nickname, + group_remark: group_remark, }, success:function(res){ if(res.status == 1){ @@ -181,7 +185,8 @@ if($('#repassword').val()!==$('#password').val()){ return json_data = {'status':0,'msg':'子渠道密码和确认密码不一致'} } - if ((promote_type == 0 || promote_type == 1) && $.trim($('#group_remark')) == '') { + var promote_type = parseInt($('[name=promote_type]').val()); + if ((promote_type == 0 || promote_type == 1) && $.trim($('#group_remark').val()) == '') { if (promote_type == 0) { return json_data = {'status':0,'msg':'请输入部门名称'} }