From f056143dee58e7447bc96e7dbd0bfa8361dd5335 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Wed, 6 Nov 2019 11:45:32 +0800 Subject: [PATCH] =?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 | 16 +-- .../Home/View/default/Promote/children.html | 123 ++++++++++++------ 2 files changed, 89 insertions(+), 50 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 47b7092be..ccb8db809 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -90,6 +90,7 @@ class PromoteService { $orderTime = isset($params['order_time']) ? $params['order_time'] : ''; $balanceCoinMode = isset($params['balance_coin_mode']) ? $params['balance_coin_mode'] : 0; $type = isset($params['type']) ? $params['type'] : 0; + $shiftIds = isset($params['shift_ids']) && $params['shift_ids'] ? $params['shift_ids'] : []; if ($fromPromoteId == $toPromoteId) { return [ @@ -123,7 +124,8 @@ class PromoteService { 'create_time' => time(), 'create_promote_id' => session('promote_auth.pid'), 'status' => 0, - 'type' => $type + 'type' => $type, + 'shift_ids' => json_encode($shiftIds) ]; if (M('ShiftTask')->add($data)) { @@ -176,8 +178,8 @@ class PromoteService { $firstMap = ['parent_id' => $fromPromote['id']]; $secondMap = ['chain' => ['like', $fromPromote['chain'] . $fromPromote['id'] . '/%']]; - if ($task['shift_ids'] != '') { - $shiftIds = json_decode($task['shift_ids'], true) ?? []; + $shiftIds = json_decode($task['shift_ids'], true) ?? []; + if (count($shiftIds) > 0) { $firstMap['id'] = ['in', $shiftIds]; $secondMap['id'] = ['in', $shiftIds]; } @@ -206,11 +208,7 @@ class PromoteService { public function shiftRemoveCoin($promote, $task) { - $shiftIds = null; - if ($task['shift_ids'] != '') { - $shiftIds = json_decode($task['shift_ids'], true) ?? []; - } - + $shiftIds = json_decode($task['shift_ids'], true) ?? []; $topPromote = $this->getTopPromote($promote); $coinRecordService = new PromoteCoinRecordService(); $promoteCoinService = new PromoteCoinService(); @@ -218,7 +216,7 @@ class PromoteService { $topBalancePlus = 0; $map = ['chain' => $promote['chain'] . $chain['id'] . '/%']; - if ($shiftIds != null) { + if (count($shiftIds) > 0) { $map['id'] = ['in', $shiftIds]; } $subPromotes = M('promote', 'tab_')->field(['id', 'balance_coin'])->where($map)->select(); diff --git a/Application/Home/View/default/Promote/children.html b/Application/Home/View/default/Promote/children.html index cf08b8e65..1c9da8225 100644 --- a/Application/Home/View/default/Promote/children.html +++ b/Application/Home/View/default/Promote/children.html @@ -88,13 +88,23 @@ 解冻 重置密码 + - 渠道迁移 + 渠道迁移 + + 取消渠道迁移 + + + + + + 换组 - 取消渠道迁移 + 取消换组 + 玩家迁移 @@ -125,7 +135,7 @@ setValue('row','{:I("get.row",10)}');