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 @@ From c4d35c26d4056222e90832a05ae74454f2a498a3 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Sat, 9 Nov 2019 16:27:35 +0800 Subject: [PATCH 08/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 --- Application/Base/Service/PromoteService.class.php | 2 +- Application/Home/Controller/PromoteController.class.php | 2 +- Application/Home/View/default/Promote/addPromote.html | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index ae08feb7e..25032493e 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -923,7 +923,7 @@ class PromoteService { { $data = [ 'account' => $params['account'], - 'password' => $this->password($params['password']), + 'password' => $this->password($params['password'], UC_AUTH_KEY), 'nickname' => $params['nickname'] ?? $params['account'], 'second_pwd' => $params['second_pwd'] ?? null, 'real_name' => $params['real_name'], diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index a1863df5a..f5df36fba 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -917,7 +917,7 @@ class PromoteController extends BaseController if (IS_POST) { $params = I('post.'); $loginPromote = $this->getLoginPromote(); - + if ($params['promote_type'] == 0 && $loginPromote['level'] > 1) { $this->ajaxReturn(['status' => 0, 'msg' => '无权限']); } diff --git a/Application/Home/View/default/Promote/addPromote.html b/Application/Home/View/default/Promote/addPromote.html index cf3f5aeba..f7efe5517 100644 --- a/Application/Home/View/default/Promote/addPromote.html +++ b/Application/Home/View/default/Promote/addPromote.html @@ -15,6 +15,7 @@
+ @@ -107,6 +108,7 @@ layer.msg('请选择所属上级'); return } + console.log(promote_type) $.ajax({ type:"POST", url:"{:U('addPromote')}", From e56256ba1dcd85fe76c5372d208cea06f437f942 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Sat, 9 Nov 2019 16:37:16 +0800 Subject: [PATCH 09/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 --- Application/Base/Service/PromoteService.class.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 25032493e..05e1372d6 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -380,18 +380,9 @@ class PromoteService { return ['status' => false, 'msg' => '系统异常,修改用户推广员失败']; } - $status = M('user_play', 'tab_')->where($otherMap)->save($updateData); - if (!$status) { - $model->rollback(); - return ['status' => false, 'msg' => '系统异常,修改玩家推广员失败']; - } + M('user_play', 'tab_')->where($otherMap)->save($updateData); + M('user_play_info', 'tab_')->where($otherMap)->save($updateData); - $status = M('user_play_info', 'tab_')->where($otherMap)->save($updateData); - if (!$status) { - $model->rollback(); - return ['status' => false, 'msg' => '系统异常,修改角色推广员失败']; - } - M('spend', 'tab_')->where($otherMap)->where(['is_check' => ['in','1,2']])->save($updateData); // 只改未对账的数据 M('deposit', 'tab_')->where($otherMap)->save($updateData); M('bind_spend', 'tab_')->where($otherMap)->save($updateData); From 00188569fe435d01b62f6b5e056caac01054f558 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Sat, 9 Nov 2019 16:38:56 +0800 Subject: [PATCH 10/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->=E6=8F=90=E7=8E=B0--bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/FinanceController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index d2a4a626d..6c95bea64 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -289,7 +289,7 @@ class FinanceController extends BaseController $this->ajaxReturn($data); } $spendIds = $spendModel->where($map)->getField('id', true); - if (!empty($spendIds)) { + if (empty($spendIds)) { $data['status'] = 0; $data['msg'] = '数据异常'; $this->ajaxReturn($data); From 21782ff951a7547d6280493de7dd52ba2a6b2c5e Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Sat, 9 Nov 2019 16:58:40 +0800 Subject: [PATCH 11/14] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=8F=AF=E4=B8=8B=E8=BD=BD=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/View/default/Download/listsIndex.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Application/Home/View/default/Download/listsIndex.html b/Application/Home/View/default/Download/listsIndex.html index 3e31eb9fd..a3de12995 100644 --- a/Application/Home/View/default/Download/listsIndex.html +++ b/Application/Home/View/default/Download/listsIndex.html @@ -138,7 +138,7 @@
*{$parentTypeName}: - 可下载 已下载 @@ -235,4 +235,9 @@ + From 3a109a644421af596ac64a8600ddb9db4b76e3fa Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Mon, 11 Nov 2019 10:34:59 +0800 Subject: [PATCH 12/14] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Home/Controller/DownloadController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Home/Controller/DownloadController.class.php b/Application/Home/Controller/DownloadController.class.php index f7028dcd7..82183649d 100644 --- a/Application/Home/Controller/DownloadController.class.php +++ b/Application/Home/Controller/DownloadController.class.php @@ -2513,7 +2513,7 @@ class DownloadController extends BaseController { foreach ($records as $key1 => $value1) { $xlsData[] = $value1; } - $this->exportExcel($xlsName, $xlsCell, $xlsData,$id); + $this->exportExcel($xlsName, $xlsCell, $xlsData,$tid); } public function rechargeExcelInfo($id,$map) { From 102013e527926ab334eaeb9fa1adcab72201f7b6 Mon Sep 17 00:00:00 2001 From: zyx Date: Mon, 11 Nov 2019 10:42:27 +0800 Subject: [PATCH 13/14] =?UTF-8?q?=E9=83=A8=E9=95=BF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/PromoteController.class.php | 65 +++++++++++++------ 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index f5df36fba..940b21e5e 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -120,10 +120,10 @@ class PromoteController extends BaseController //计算当日用户充值数据 // $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.grand_id = {$promote_id} "; //计算当日用户充值数据 - $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.chain like '%/{$promote_id}/%' "; +// $map['_string'] = "promote_id = {$promote_id} or tab_promote.parent_id = {$promote_id} or tab_promote.chain like '%/{$promote_id}/%' "; $pay_time = " between 0 and " . time(); - $spendData = $this->caculateSpend($pay_time, $map['_string']); + $spendData = $this->caculateSpend($pay_time, []); $promoteId = implode(',', $promoteId); if ($promoteId) { @@ -136,21 +136,39 @@ class PromoteController extends BaseController $yesterdays = total(5); $week = total(2); $mounth = total(3); + + $map['tp1.id'] = $promote_id; + //计算今日的统计数据 - $data = M('User', 'tab_') - ->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count, - IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 , - count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday, - count(IF(register_time ' . $today . ',1,null)) as today, - count(IF(register_time ' . $week . ',1,null)) as week, - count(IF(register_time ' . $mounth . ',1,null)) as mounth') - ->join('tab_promote on promote_id = tab_promote.id', 'left') + + $data = M('promote', 'tab_')->alias('tp1')->field('tp1.account as promote_account,tp1.id, date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(u.id) as count, + count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday, + count(IF(register_time ' . $today . ',1,null)) as today, + count(IF(register_time ' . $week . ',1,null)) as week, + count(IF(register_time ' . $mounth . ',1,null)) as mounth') + ->join("tab_promote AS tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%')", 'left') + ->join("tab_user as u on tp2.id = u.promote_id", 'left') + ->join(false) ->where($map) - ->group('promote_id1') - ->having('promote_id != 0') - ->order('count desc,register_time') + ->group('tp1.id') + ->order('count desc, register_time') ->find(); -// echo M('User','tab_')->_sql();die(); + +// $data = M('User', 'tab_') +// ->field('promote_account,promote_id,date_format(FROM_UNIXTIME(register_time),"%Y-%m-%d") AS time, count(tab_user.id) as count, +// IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1 , +// count(IF(register_time ' . $yesterdays . ',1,null)) as yesterday, +// count(IF(register_time ' . $today . ',1,null)) as today, +// count(IF(register_time ' . $week . ',1,null)) as week, +// count(IF(register_time ' . $mounth . ',1,null)) as mounth') +// ->join('tab_promote on promote_id = tab_promote.id', 'left') +// ->where($map) +// ->group('promote_id1') +// ->having('promote_id != 0') +// ->order('count desc,register_time') +// ->find(); +// var_dump($data);die(); +// echo M('promote', 'tab_')->_sql();die(); $total_money = $this->pay_total(0, 0, $promoteId); $today_add_user_money = $this->pay_total(1, 1, $promoteId); @@ -161,11 +179,12 @@ class PromoteController extends BaseController //计算昨天用户的统计数据,当日用户充值数据 $pay_time = " between {$yesterday_start} and {$yesterday_end}"; $createTime = ['between', array($yesterday_start, $yesterday_end - 1)]; - $yesterdaySpendData = $this->caculateSpend($pay_time, $map['_string'], $createTime); + $yesterdaySpendData = $this->caculateSpend($pay_time, [], $createTime); - $todayAddSpendData = $this->caculateSpend($pay_time, $map['_string'], [], 1); + $todayAddSpendData = $this->caculateSpend($pay_time, [], [], 1); +// var_dump($todayAddSpendData);die(); - $mounthAddSpendData = $this->caculateSpend($pay_time, $map['_string'], [], 2); + $mounthAddSpendData = $this->caculateSpend($pay_time, [], [], 2); $yesterday_user_regist_count = M("user", "tab_")->where( array("promote_id" => array('in', $promoteId), @@ -289,10 +308,14 @@ class PromoteController extends BaseController ->group('promote_id') ->select(false); - $spendData = $spend->field('a.promote_account,a.promote_id,a.time,sum(a.scount) as count,sum(a.today) as today,sum(a.week) as week,sum(a.mounth) as mounth,IF(tab_promote.grand_id>0,tab_promote.grand_id,IF(tab_promote.grand_id=0 and tab_promote.parent_id >0,tab_promote.parent_id,promote_id)) as promote_id1') - ->join('tab_promote on promote_id = tab_promote.id', 'left') - ->where($condition) - ->table('(' . $spendData . ') as a')->group('promote_id1')->order('count desc,a.ordertime')->find(); +// $promote_map = "tp1.`chain` = '/'"; + $promote_id = get_pid(); + $promote_map = "tp1.`id` = {$promote_id}"; + + $spendData = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth') + ->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') where $promote_map ) AS t ON promote_id = t.id") + ->where($condition)->table('(' . $spendData . ') as a')->group('t.pid')->order('count desc,a.ordertime')->find(); +// var_dump($spendData);die(); $spendData['rand'] = 1; $spendData['count'] = $spendData['count'] / 100; $spendData['today'] = $spendData['today'] / 100; From 6c636a92f56faa3c2cd443cd4f043e2021a4fecf Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 11 Nov 2019 10:50:21 +0800 Subject: [PATCH 14/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Service/GameSourceService.class.php | 6 +++++- Application/Base/Tool/Base62.class.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Application/Base/Service/GameSourceService.class.php b/Application/Base/Service/GameSourceService.class.php index 8f844413d..f8b748d83 100644 --- a/Application/Base/Service/GameSourceService.class.php +++ b/Application/Base/Service/GameSourceService.class.php @@ -74,7 +74,7 @@ class GameSourceService { 'game_id' => $game['id'], 'game_name' => $game['game_name'], 'game_appid' => $game['game_appid'], - 'promote_id' => $apply ? $apply['promote_id'] : '', + 'promote_id' => $apply ? $apply['promote_id'] : '0', 'promote_account' => $apply ? $apply['promote_account'] : '自然渠道', 'source_version' => $gameSource['source_version'], ]; @@ -117,6 +117,10 @@ class GameSourceService { { $zip = new \ZipArchive(); if ($zip->open($zipFile, \ZipArchive::CREATE)) { + $rows = explode('/' . $distFolder); + unset($rows[count($rows) -1]); + $txChannelFolder = implode('/', $rows); + $zip->deleteName($txChannelFolder); $zip->addEmptyDir($distFolder); $zip->close(); return true; diff --git a/Application/Base/Tool/Base62.class.php b/Application/Base/Tool/Base62.class.php index b0cc27bf5..b7eba121e 100644 --- a/Application/Base/Tool/Base62.class.php +++ b/Application/Base/Tool/Base62.class.php @@ -59,7 +59,7 @@ class Base62 return implode('', $result); } - public static function decode($string, $decodes) + public static function decode($string) { $decodes = self::getIndexChars(self::ENCODES); $chars = self::getCharArray($string);