From 9d3dfd622b001fa28d4ec16cdfe136f621363b0f Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sat, 9 Nov 2019 15:43:35 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/PromoteModel.class.php | 3 ++- Application/Home/Controller/IndexController.class.php | 3 ++- Application/User/Api/PromoteApi.class.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Model/PromoteModel.class.php b/Application/Admin/Model/PromoteModel.class.php index 40d0da370..a1499ae4b 100644 --- a/Application/Admin/Model/PromoteModel.class.php +++ b/Application/Admin/Model/PromoteModel.class.php @@ -165,7 +165,8 @@ class PromoteModel extends Model{ /** * 退出登录 */ - public function logout(){ + public function logout() + { session('promote_auth', null); session('promote_auth_sign', null); session('game_divide_second_pwd', null); diff --git a/Application/Home/Controller/IndexController.class.php b/Application/Home/Controller/IndexController.class.php index 7f311defd..f91d6a4e6 100644 --- a/Application/Home/Controller/IndexController.class.php +++ b/Application/Home/Controller/IndexController.class.php @@ -287,7 +287,8 @@ class IndexController extends HomeController /** * 退出登录 */ - public function logout(){ + public function logout() + { $Promote = new PromoteApi(); $Promote->logout(); redirect(U('Index/index')); diff --git a/Application/User/Api/PromoteApi.class.php b/Application/User/Api/PromoteApi.class.php index e527967fc..1fdff9a27 100644 --- a/Application/User/Api/PromoteApi.class.php +++ b/Application/User/Api/PromoteApi.class.php @@ -80,7 +80,8 @@ class PromoteApi extends Api{ /** * 退出登录 */ - public function logout(){ + public function logout() + { $this->model->logout(); } From f5dd537074646e47c0d0f0f133f2bfcd39a7a885 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Sat, 9 Nov 2019 15:44:04 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/Home/js/20170831/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/Home/js/20170831/common.js b/Public/Home/js/20170831/common.js index 6cbdf3c1e..e737460f8 100644 --- a/Public/Home/js/20170831/common.js +++ b/Public/Home/js/20170831/common.js @@ -186,10 +186,10 @@ $(function(){ window.updateAlert = function (text,status,c) { switch(status){ case 1: - layer.msg(text, {icon: 2}); + layer.msg(text, {icon: 1}); break; default: - layer.msg(text, {icon: 1}); + layer.msg(text, {icon: 2}); break; } } From 05120a4146a2ea76fb44ef085453f51383f7c820 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sat, 9 Nov 2019 15:52:31 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0-?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Public/Home/js/20170831/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/Home/js/20170831/common.js b/Public/Home/js/20170831/common.js index 6cbdf3c1e..e737460f8 100644 --- a/Public/Home/js/20170831/common.js +++ b/Public/Home/js/20170831/common.js @@ -186,10 +186,10 @@ $(function(){ window.updateAlert = function (text,status,c) { switch(status){ case 1: - layer.msg(text, {icon: 2}); + layer.msg(text, {icon: 1}); break; default: - layer.msg(text, {icon: 1}); + layer.msg(text, {icon: 2}); break; } } From 85e466c3fd046c5f895037cbba381ba8d71f080d Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Sat, 9 Nov 2019 15:54:11 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Service/PromoteService.class.php | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index ecfe350bf..ae08feb7e 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -319,17 +319,19 @@ class PromoteService { $toPromote = M('promote', 'tab_')->where(['id' => $toPromoteId])->find(); $fromPromote = M('promote', 'tab_')->where(['id' => $fromPromoteId])->find(); - if (!$fromPromote && count($shiftIds) == 0) { + $toPromote = $toPromote ?? ['id' => 0, 'account' => '官方渠道']; + $fromPromote = $fromPromote ?? ['id' => 0, 'account' => '官方渠道']; + + + if ($fromPromote['id'] == 0 && count($shiftIds) == 0) { return ['status' => false, 'msg' => '官方渠道玩家不能全部迁移']; } $map = []; + $map['promote_id'] = $fromPromote['id']; if (count($shiftIds) > 0) { $map['id'] = ['in', $shiftIds]; } - if ($fromPromote) { - $map['promote_id'] = $fromPromote['id']; - } $users = M('user', 'tab_')->field(['id', 'account', 'nickname'])->where($map)->select(); @@ -339,14 +341,14 @@ class PromoteService { 'user_id' => $item['id'], 'user_account' => $item['account'], 'user_nickname' => $item['nickname'], - 'promote_id' => $fromPromote ? $fromPromote['id'] : 0, - 'promote_account' => $fromPromote ? $fromPromote['account'] : '官方渠道', - 'promote_id_to' => $toPromote ? $toPromote['id'] : 0, - 'promote_account_to' => $toPromote ? $toPromote['account'] : '官方渠道', + 'promote_id' => $fromPromote['id'], + 'promote_account' => $fromPromote['account'], + 'promote_id_to' => $toPromote['id'], + 'promote_account_to' => $toPromote['account'], 'remark' => '玩家迁移', 'create_time' => time(), - 'op_id' => $createPromote['id'], - 'op_account' => $createPromote['account'], + 'op_id' => $createPromote ? $createPromote['id'] : 0, + 'op_account' => $createPromote ? $createPromote['account'] : '', 'op_type' => 1, 'bind_type' => 1, ]; @@ -362,8 +364,8 @@ class PromoteService { } $updateData = [ - 'promote_id' => $toPromote ? $toPromote['id'] : 0, - 'promote_account' => $toPromote ? $toPromote['account'] : '官方渠道' + 'promote_id' => $toPromote['id'], + 'promote_account' => $toPromote['account'] ]; $map = $otherMap = ['promote_id' => $fromPromote['id']]; From 438594827cba773a1fd812368fb4878469e407ca Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Sat, 9 Nov 2019 16:04:30 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E9=BB=98=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Data/update.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Data/update.sql b/Data/update.sql index 15b22eb0d..731351d51 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -368,4 +368,6 @@ ALTER TABLE `sys_shift_task` ADD COLUMN `remark` varchar(255) NOT NULL DEFAULT ' ALTER TABLE `tab_withdraw` ADD COLUMN `transfer_proof` int(11) NOT NULL DEFAULT 0 COMMENT '汇款证明' AFTER `settlement_end_time`; -- 2019-11-08 cxj -ALTER TABLE `sys_document_download` MODIFY COLUMN `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '文档ID' FIRST; \ No newline at end of file +ALTER TABLE `sys_document_download` MODIFY COLUMN `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '文档ID' FIRST; +ALTER TABLE `tab_promote` + CHANGE COLUMN `ver_status` `ver_status` TINYINT(2) NULL DEFAULT '3' COMMENT '资质认证审核状态(1是审核成功,2审核失败,3未审核)' AFTER `child_game_permission`; \ No newline at end of file From 84448998ddacdf527373d104bdbf4bc56d07ec00 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Sat, 9 Nov 2019 16:19:06 +0800 Subject: [PATCH 06/14] tubiao --- Public/Home/js/20170831/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Public/Home/js/20170831/common.js b/Public/Home/js/20170831/common.js index e737460f8..06440ccfb 100644 --- a/Public/Home/js/20170831/common.js +++ b/Public/Home/js/20170831/common.js @@ -78,9 +78,9 @@ $(function(){ $.get(target).success(function(data){ if (data.status==1) { if (data.url) { - updateAlert(data.info + ' 页面即将自动跳转~','alert-success'); + updateAlert(data.info + ' 页面即将自动跳转~',1,'alert-success'); }else{ - updateAlert(data.info,'alert-success'); + updateAlert(data.info,1,'alert-success'); } setTimeout(function(){ if (data.url) { From 669e641c1ee8402955bd99b83067e8ceb75c93bf Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sat, 9 Nov 2019 16:23:03 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86->(=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E4=B8=AD=E5=BF=83|=E7=BB=93=E7=AE=97=E6=98=8E=E7=BB=86--?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E6=97=A5=E6=9C=9F=E8=8C=83=E5=9B=B4=E8=B0=83?= =?UTF-8?q?=E6=95=B4)(=E6=8F=90=E7=8E=B0=E8=AE=B0=E5=BD=95->=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E5=8D=95--=E4=BE=A7=E8=BE=B9=E6=A0=8F=E9=AB=98?= =?UTF-8?q?=E4=BA=AE=E4=BF=AE=E5=A4=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/FinanceController.class.php | 161 +++++++++--------- .../Home/View/default/Finance/index.html | 2 +- .../View/default/Finance/settlementDtl.html | 14 +- .../View/default/Public/promote_base.html | 2 +- 4 files changed, 94 insertions(+), 85 deletions(-) diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 1fd08d16f..d2a4a626d 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -97,40 +97,44 @@ class FinanceController extends BaseController $endTime = strtotime($initEndTime); $endTime = $endTime + 3600 * 24; - $map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%']; - $promoteIds = M('promote', 'tab_')->where($map)->getField('id', true); - $promoteIds[] = $this->loginPromote['id']; - $promoteIds = implode(',', $promoteIds); - - $map = []; - $map['pay_status'] = 1; - $map['promote_id'] = ['in', $promoteIds]; - $income = $model->field("sum(if(pay_time < $thisDay, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as history_income, + $records = []; + $income = []; + if (intval($endTime - $begTime) / (24 * 3600) <= 31) { + $map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%']; + $promoteIds = M('promote', 'tab_')->where($map)->getField('id', true); + $promoteIds[] = $this->loginPromote['id']; + $promoteIds = implode(',', $promoteIds); + + $map = []; + $map['pay_status'] = 1; + $map['promote_id'] = ['in', $promoteIds]; + $income = $model->field("sum(if(pay_time < $thisDay, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as history_income, sum(if(pay_time >= $thisMonth, if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as this_month_income, sum(if((pay_time >= $yesterday and pay_time < $thisDay), if(selle_ratio > 0, pay_amount * selle_ratio, 0), 0)) as yesterday_income, sum(if(pay_time < $thisDay, if(selle_status = 0, pay_amount * selle_ratio, 0), 0)) as balance") - ->where($map) - ->find(); + ->where($map) + ->find(); - foreach ($income as &$value) { - $value = bcdiv($value, 100, 2); - } + foreach ($income as &$value) { + $value = bcdiv($value, 100, 2); + } - $map['pay_time'] = ['between', [$begTime, $endTime]]; - $dayList = $this->getDayList($begTime, $endTime); - $data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day, + $map['pay_time'] = ['between', [$begTime, $endTime]]; + $dayList = $this->getDayList($begTime, $endTime); + $data = $model->field('FROM_UNIXTIME(pay_time, "%Y-%m-%d") as day, sum(if(selle_ratio > 0, pay_amount * selle_ratio, 0)) as income') - ->where($map) - ->group('day') - ->select(); - $data = $this->assembleRecords($data, $dayList, 'income'); - foreach ($dayList as $day) { - $date = date('Ymd', strtotime($day)); - $records[] = [ - 'day' => $date, - 'income' => bcdiv($data[$day], 100, 2), - 'url' => U('settlementDtl', array('begtime' => $day, 'endtime' => $day)) - ]; + ->where($map) + ->group('day') + ->select(); + $data = $this->assembleRecords($data, $dayList, 'income'); + foreach ($dayList as $day) { + $date = date('Ymd', strtotime($day)); + $records[] = [ + 'day' => $date, + 'income' => bcdiv($data[$day], 100, 2), + 'url' => U('settlementDtl', array('begtime' => $day, 'endtime' => $day)) + ]; + } } $this->assign('income', $income); @@ -164,6 +168,7 @@ class FinanceController extends BaseController $initEndTime = empty(I('endtime')) ? $initEndTime : I('endtime'); $begTime = strtotime($initBegTime); $endTime = strtotime($initEndTime); + $endTime += 3600 * 24; $parameter['p'] = $page; $parameter['row'] = $row; @@ -171,63 +176,61 @@ class FinanceController extends BaseController $parameter['begtime'] = $initBegTime; $parameter['endtime'] = $initEndTime; - $map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%']; - $ids = M('promote', 'tab_')->where($map)->getField('id', true); - $ids[] = $this->loginPromote['id']; - $ids = implode(',', $ids); - - $map = []; - $map['promote_id'] = ['in', $ids]; - if (!empty($payOrderNumber)) { - $map['pay_order_number'] = $payOrderNumber; - } - if (!empty($begTime) && empty($endTime)) { - $map['pay_time'] = ['egt', $begTime]; - } elseif (empty($begTime) && !empty($endTime)) { - $map['pay_time'] = ['elt', $endTime + 86399]; - } elseif (!empty($begTime) && !empty($endTime)) { - $map['pay_time'] = ['between', [$begTime, $endTime + 86399]]; - } - - $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') - ->where($map) - ->order('id desc') - ->page($page, $row) - ->select(); - $count = $model->where($map)->count(); - - //提现状态 - $withdrawIds = [0]; - foreach ($data as $key => $value) { - if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) { - $withdrawIds[] = $value['withdraw_id']; + $data = []; + $count = 0; + if (intval($endTime - $begTime) / (24 * 3600) <= 31) { + $map['chain'] = ['like', $this->loginPromote['chain'] . $this->loginPromote['id'] . '/%']; + $ids = M('promote', 'tab_')->where($map)->getField('id', true); + $ids[] = $this->loginPromote['id']; + $ids = implode(',', $ids); + + $map = []; + $map['promote_id'] = ['in', $ids]; + $map['pay_time'] = ['between', [$begTime, $endTime]]; + if (!empty($payOrderNumber)) { + $map['pay_order_number'] = $payOrderNumber; } - } - $withdrawStatus = M('withdraw', 'tab_') - ->where(array('id' => ['in', $withdrawIds])) - ->getField('id,status'); - foreach ($data as &$list) { + $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') + ->where($map) + ->order('id desc') + ->page($page, $row) + ->select(); + $count = $model->where($map)->count(); + //提现状态 - if ($list['pay_status'] == 1) { - switch ($list['selle_status']) { - case 0: - $list['selle_status'] = '未提现'; - break; - default: - if ($list['withdraw_id'] > 0) { - $list['selle_status'] = FinanceController::$withdrawStatus[$withdrawStatus[$list['withdraw_id']]]; - } else { - $list['selle_status'] = ''; - } - break; + $withdrawIds = [0]; + foreach ($data as $key => $value) { + if ($value['withdraw_id'] > 0 && !in_array($value['withdraw_id'], $withdrawIds)) { + $withdrawIds[] = $value['withdraw_id']; } - } else { - $list['selle_status'] = '支付失败'; } + $withdrawStatus = M('withdraw', 'tab_') + ->where(array('id' => ['in', $withdrawIds])) + ->getField('id,status'); - $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); - $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); + foreach ($data as &$list) { + //提现状态 + if ($list['pay_status'] == 1) { + switch ($list['selle_status']) { + case 0: + $list['selle_status'] = '未提现'; + break; + default: + if ($list['withdraw_id'] > 0) { + $list['selle_status'] = FinanceController::$withdrawStatus[$withdrawStatus[$list['withdraw_id']]]; + } else { + $list['selle_status'] = ''; + } + break; + } + } else { + $list['selle_status'] = '支付失败'; + } + + $list['income'] = bcmul($list['pay_amount'], bcdiv($list['selle_ratio'], 100, 2), 2); + $list['pay_time'] = date('Y-m-d H:i:s', $list['pay_time']); + } } $page = set_pagination($count, $row, $parameter); diff --git a/Application/Home/View/default/Finance/index.html b/Application/Home/View/default/Finance/index.html index 8e6dd89a6..3b5158da2 100644 --- a/Application/Home/View/default/Finance/index.html +++ b/Application/Home/View/default/Finance/index.html @@ -126,7 +126,7 @@ layer.msg('开始时间必须小于等于结束时间', {icon: 5}); return false; } - if ((edate - sdate) > 2505600) { + if ((edate - sdate) > 2592000) { layer.msg('时间间隔不能超过30天,请重新选择日期', {icon: 5}); return false; } diff --git a/Application/Home/View/default/Finance/settlementDtl.html b/Application/Home/View/default/Finance/settlementDtl.html index cd834f78f..b38ea9876 100644 --- a/Application/Home/View/default/Finance/settlementDtl.html +++ b/Application/Home/View/default/Finance/settlementDtl.html @@ -210,12 +210,18 @@ }); $('#submit').click(function () { - var sdate = $('#sdate').val(); - var edate = $('#edate').val(); - if (Date.parse(sdate) > Date.parse(edate)) { - layer.msg('开始时间必须小于等于结束时间'); + var sdate = Date.parse($('#sdate').val()) / 1000; + var edate = Date.parse($('#edate').val()) / 1000; + + if (sdate > edate) { + layer.msg('开始时间必须小于等于结束时间', {icon: 5}); + return false; + } + if ((edate - sdate) > 2592000) { + layer.msg('时间间隔不能超过30天,请重新选择日期', {icon: 5}); return false; } + var url = $(this).attr('url'); console.log(url); var query = $('.jssearch').find('input').serialize(); diff --git a/Application/Home/View/default/Public/promote_base.html b/Application/Home/View/default/Public/promote_base.html index 0c2687b6f..97d8cf52b 100644 --- a/Application/Home/View/default/Public/promote_base.html +++ b/Application/Home/View/default/Public/promote_base.html @@ -73,7 +73,7 @@