From 689cc08b69ccffec389c16dc6e9c167d38e9ce3f Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Fri, 1 Nov 2019 15:50:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/access_data_foldline.txt | 2 +- .../Base/Service/PromoteService.class.php | 14 +++---- .../Controller/FinanceController.class.php | 17 +++++++++ .../Controller/PromoteController.class.php | 37 ++++++++++++++----- .../Home/View/default/Promote/children.html | 36 ++++++++++++++---- 5 files changed, 81 insertions(+), 25 deletions(-) create mode 100644 Application/Home/Controller/FinanceController.class.php diff --git a/Application/Admin/Controller/access_data_foldline.txt b/Application/Admin/Controller/access_data_foldline.txt index f2bc7fb38..2d8d3add6 100644 --- a/Application/Admin/Controller/access_data_foldline.txt +++ b/Application/Admin/Controller/access_data_foldline.txt @@ -1 +1 @@ -{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"sum":{"news":0,"active":0,"player":0,"money":0},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":0},{"time":"17:00","count":0},{"time":"18:00","count":0},{"time":"19:00","count":0},{"time":"20:00","count":0},{"time":"21:00","count":0},{"time":"22:00","count":0},{"time":"23:00","count":0}]} \ No newline at end of file +{"news":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":21},{"time":"17:00","count":10},{"time":"18:00","count":7},{"time":"19:00","count":11},{"time":"20:00","count":11},{"time":"21:00","count":8},{"time":"22:00","count":11},{"time":"23:00","count":10}],"sum":{"news":89,"active":2506,"player":378,"money":33093},"active":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":851},{"time":"17:00","count":280},{"time":"18:00","count":142},{"time":"19:00","count":105},{"time":"20:00","count":81},{"time":"21:00","count":143},{"time":"22:00","count":420},{"time":"23:00","count":484}],"player":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":179},{"time":"17:00","count":54},{"time":"18:00","count":28},{"time":"19:00","count":24},{"time":"20:00","count":14},{"time":"21:00","count":12},{"time":"22:00","count":27},{"time":"23:00","count":40}],"money":[{"time":"0:00","count":0},{"time":"1:00","count":0},{"time":"2:00","count":0},{"time":"3:00","count":0},{"time":"4:00","count":0},{"time":"5:00","count":0},{"time":"6:00","count":0},{"time":"7:00","count":0},{"time":"8:00","count":0},{"time":"9:00","count":0},{"time":"10:00","count":0},{"time":"11:00","count":0},{"time":"12:00","count":0},{"time":"13:00","count":0},{"time":"14:00","count":0},{"time":"15:00","count":0},{"time":"16:00","count":"15639.00"},{"time":"17:00","count":"5328.00"},{"time":"18:00","count":"5490.00"},{"time":"19:00","count":"1178.00"},{"time":"20:00","count":"1274.00"},{"time":"21:00","count":"484.00"},{"time":"22:00","count":"2327.00"},{"time":"23:00","count":"1373.00"}]} \ No newline at end of file diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 4442beb3d..c8b3e8381 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -155,6 +155,11 @@ class PromoteService { } public function shiftPromote($task) + { + + } + + public function shiftChildPromote($task) { $model = new Model(); $model->startTrans(); @@ -162,19 +167,14 @@ class PromoteService { $coinRecordService = new PromoteCoinRecordService(); $promoteCoinService = new PromoteCoinService(); - $toPromoteId = $task['to_promote_id']; - $fromPromoteId = $task['from_promote_id']; $balanceCoinMode = $task['balance_coin_mode']; - $toPromote = D('promote')->where(['id' => $toPromoteId])->find(); - $fromPromote = D('promote')->where(['id' => $fromPromoteId])->find(); + $toPromote = M('promote', 'tab_')->where(['id' => $task['to_promote_id']])->find(); + $fromPromote = M('promote', 'tab_')->where(['id' => $task['from_promote_id']])->find(); $topPromote = $this->getTopPromote($fromPromote); $status = $this->shiftRemoveCoin($fromPromote, $topPromote, $task); - // 测试 - // $model->rollback(); - if (!$status) { $model->rollback(); return ['status' => false, 'msg' => '系统异常2']; diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php new file mode 100644 index 000000000..8296697fe --- /dev/null +++ b/Application/Home/Controller/FinanceController.class.php @@ -0,0 +1,17 @@ +paginate($query); $ids = array_column($records, 'id'); - $parentIds = array_column($records, 'parent_id'); $countList = []; $playerList = []; @@ -920,10 +919,10 @@ class PromoteController extends BaseController $playerList = M('user_play', 'tab_')->field(['count(*)' => 'count', 'promote_id' => 'promote_id'])->where(['promote_id' => ['in', $ids]])->group('promote_id')->select(); $shiftList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 1, 'promote_id' => ['in', $ids]])->group('from_promote_id')->select(); $shiftPlayerList = M('shift_task', 'sys_')->field(['count(*)' => 'count', 'from_promote_id' => 'from_promote_id'])->where(['status' => 0, 'type' => 2, 'promote_id' => ['in', $ids]])->group('from_promote_id')->select(); - $countList = array_column($countList, 'parent_id'); - $playerList = array_column($playerList, 'promote_id'); - $shiftList = array_column($shiftList, 'from_promote_id'); - $shiftPlayerList = array_column($shiftPlayerList, 'from_promote_id'); + $hasChildList = array_column($countList, 'parent_id'); + $hasPlayerList = array_column($playerList, 'promote_id'); + $hasShiftList = array_column($shiftList, 'from_promote_id'); + $hasShiftPlayerList = array_column($shiftPlayerList, 'from_promote_id'); } if ($promoteType == 0) { @@ -935,10 +934,10 @@ class PromoteController extends BaseController } $this->assign('promoteTypeName', $promoteTypeName); - $this->assign('countList', $countList); - $this->assign('playerList', $playerList); - $this->assign('shiftList', $shiftList); - $this->assign('shiftPlayerList', $shiftPlayerList); + $this->assign('hasChildList', $hasChildList); + $this->assign('hasPlayerList', $hasPlayerList); + $this->assign('hasShiftList', $hasShiftList); + $this->assign('hasShiftPlayerList', $hasShiftPlayerList); $this->assign('count', $count); $this->assign('pagination', $pagination); $this->assign('records', $records); @@ -2262,6 +2261,26 @@ class PromoteController extends BaseController $this->display(); } } + + public function getSubPromotes() + { + $level = I('level', 0); + $promoteId = I('promote_id', 0); + $promote = $this->getLoginPromote(); + if ($promoteId > 0) { + $promote = M('promote', 'tab_')->where(['id' => $promoteId])->find(); + } + $map = ['chain' => ['like', $promote['chain'] . $promote['id'] . '/%']]; + if ($level > 0) { + $map['level'] = $level; + } + $promotes = M('promote', 'tab_')->field(['id', 'account', 'real_name'])->where($map)->select(); + $this->ajaxReturn([ + 'status' => 1, + 'msg' => '成功', + 'data' => ['promotes' => $promotes] + ]); + } } diff --git a/Application/Home/View/default/Promote/children.html b/Application/Home/View/default/Promote/children.html index 6cd7cc6ee..cf08b8e65 100644 --- a/Application/Home/View/default/Promote/children.html +++ b/Application/Home/View/default/Promote/children.html @@ -13,7 +13,8 @@