From e66893dc7fdc97c856c425e71abe2a9ab95abccb Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Fri, 27 Dec 2019 13:43:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=85=AC=E4=BC=9A=E5=88=86=E6=88=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86--=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PromoteGameRatioController.class.php | 52 +++++++++++++++++++ .../View/PromoteGameRatio/applyRatio.html | 39 +++++++++++++- Application/Admin/View/Query/settlement.html | 28 ---------- 3 files changed, 89 insertions(+), 30 deletions(-) diff --git a/Application/Admin/Controller/PromoteGameRatioController.class.php b/Application/Admin/Controller/PromoteGameRatioController.class.php index 635d62fde..7952b4fa2 100644 --- a/Application/Admin/Controller/PromoteGameRatioController.class.php +++ b/Application/Admin/Controller/PromoteGameRatioController.class.php @@ -146,6 +146,10 @@ class PromoteGameRatioController extends ThinkController if (empty($promoteGameRatio)) { $this->error('参数异常'); } + + $promoteId = $promoteGameRatio['promote_id']; + $this->isWithdraw($promoteId, $save['begin_time']);//是否存在开始时间后已提现数据 + if ($promoteGameRatio['status'] == 1) { $save['last_ratio'] = $promoteGameRatio['ratio']; $save['last_ratio_status'] = 1; @@ -161,6 +165,7 @@ class PromoteGameRatioController extends ThinkController } $promoteId = intval($params['promote_id']); $gameId = intval($params['game_id']); + $this->isWithdraw($promoteId, $save['begin_time']);//是否存在开始时间后已提现数据 $promote = M('promote', 'tab_')->find($promoteId); if (empty($promote) || $promote['level'] != 1) { @@ -217,6 +222,26 @@ class PromoteGameRatioController extends ThinkController } } + private function isWithdraw($promoteId, $beginTime) + { + $promote = M('promote', 'tab_')->find($promoteId); + if (empty($promote)) { + $this->error("数据异常"); + } + if ($promote['level'] != 1) { + $this->error("该推广员不是会长账号,无法执行此操作"); + } + + $withdrawMap['promote_id'] = $promoteId; + $withdrawMap['status'] = ['neq', -2]; + $withdrawMap['settlement_end_time'] = ['egt', $beginTime]; + $withdraw = M('withdraw', 'tab_')->where($withdrawMap)->order('create_time desc')->find(); + if (!empty($withdraw) && $withdraw['status'] != -2) { + $time = date('Y-m-d', $withdraw['create_time']); + $this->error("{$time}之前的订单已经申请提现, 无法变更分成比例,请重新选择开始时间"); + } + } + public function setStatus($status) { $params = I('post.'); @@ -228,6 +253,7 @@ class PromoteGameRatioController extends ThinkController if (empty($status) || !in_array($status, [-1, 1])) { $this->error('操作失败'); } + $time = time(); $map['id'] = ['in', $ids]; $map['status'] = 0; @@ -240,6 +266,32 @@ class PromoteGameRatioController extends ThinkController } $result = D(self::MODEL_NAME)->where($map)->save($save); if ($result) { + if ($status == 1) { + foreach ($ids as $id) { + $promoteGameRatio = D(self::MODEL_NAME)->find($id); + if (!empty($promoteGameRatio)) { + if ($promoteGameRatio['begin_time'] <= strtotime(date('Y-m-d', time()))) { + $promoteId = $promoteGameRatio['promote_id']; + $promoteMap['chain'] = ['like', "/{$promoteId}/%"]; + $promoteIds = M('promote', 'tab_')->where($promoteMap)->getField('id', true); + $promoteIds[] = $promoteId; + + $spendMap['promote_id'] = ['in', $promoteIds]; + $spendMap['game_id'] = $promoteGameRatio['game_id']; + if ($promoteGameRatio['end_time'] > 0) { + $spendMap['pay_time'] = ['between', [$promoteGameRatio['begin_time'], $promoteGameRatio['end_time'] + 3600 * 24 - 1]]; + } else { + $spendMap['pay_time'] = ['egt', $promoteGameRatio['begin_time']]; + } + $spendMap['pay_status'] = 1; + $spendMap['selle_status'] = 0; + + $spendSave['selle_ratio'] = $promoteGameRatio['ratio']; + M('spend', 'tab_')->where($spendMap)->save($spendSave); + } + } + } + } $this->success('操作成功'); } else { $this->error('操作失败'); diff --git a/Application/Admin/View/PromoteGameRatio/applyRatio.html b/Application/Admin/View/PromoteGameRatio/applyRatio.html index c941573b0..3ce73e049 100644 --- a/Application/Admin/View/PromoteGameRatio/applyRatio.html +++ b/Application/Admin/View/PromoteGameRatio/applyRatio.html @@ -112,7 +112,7 @@
- @@ -203,7 +203,42 @@ $(function(){ }); } - $('submit') + $('#submit').click(function (e) { + var target = $('form').get(0).action; + var query = $('form').serialize(); + var that = this; + $(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true); + $.post(target,query).success(function(data){ + if(layer) {layer.closeAll('loading');} + if (data.status==1) { + if (data.url) { + updateAlert(data.info + ' 页面即将自动跳转~'); + }else{ + updateAlert(data.info); + } + setTimeout(function(){ + $(that).removeClass('disabled').prop('disabled',false); + if (data.url) { + location.href=data.url; + }else if( $(that).hasClass('no-refresh')){ + $('#tip').find('.tipclose').click(); + }else{ + location.reload(); + } + },1500); + }else{ + updateAlert(data.info,'tip_error'); + setTimeout(function(){ + $(that).removeClass('disabled').prop('disabled',false); + if (data.url) { + location.href=data.url; + }else{ + $('#tip').find('.tipclose').click(); + } + },3000); + } + }); + }); }); diff --git a/Application/Admin/View/Query/settlement.html b/Application/Admin/View/Query/settlement.html index 0d1b9c874..0ad466c5f 100644 --- a/Application/Admin/View/Query/settlement.html +++ b/Application/Admin/View/Query/settlement.html @@ -46,35 +46,7 @@
- -
-
- 参与结算设置: - -      - -
-
-

注意①:推广结算只结算消费到游戏的所有订单记录。(系统默认全部排除绑币,可视情况自行勾选)

-

注意②:包含绑币勾选请慎重,由于玩家账户部分绑币的来源属于后台发放或者会长代充等,涉及到成本盈亏,是否参与推广员结算请考虑清楚!

-

注意③:推广结算时间请按规律时间统一结算,否则时间不统一容易导致个别游戏在统一时间内无法结算。(结算时间只可选到前一天)

-
-
-
- - -
- -
- -
From 453c0c36823b1284d5717378e331d06b6c4674a5 Mon Sep 17 00:00:00 2001 From: sunke <18850253506@163.com> Date: Fri, 27 Dec 2019 13:44:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=BD=92=E5=B1=9E?= =?UTF-8?q?=E5=90=8D=E8=AF=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/View/Promote/linkInfo.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Application/Admin/View/Promote/linkInfo.html b/Application/Admin/View/Promote/linkInfo.html index d7bda346e..4609a2a0e 100644 --- a/Application/Admin/View/Promote/linkInfo.html +++ b/Application/Admin/View/Promote/linkInfo.html @@ -32,9 +32,9 @@
-

下载链接

+

链接归属查询

-

说明:下载链接信息解析

+

说明:链接归属信息解析

@@ -53,10 +53,10 @@
- +
- +
From 6a28abedc093da8a06d9b5d29dcf2a45d38aa6a7 Mon Sep 17 00:00:00 2001 From: zhanglingsheng Date: Fri, 27 Dec 2019 14:04:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=A1=A5=E5=8D=95=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/BehaviorLogController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Admin/Controller/BehaviorLogController.class.php b/Application/Admin/Controller/BehaviorLogController.class.php index 5306bc473..ddfb070e8 100644 --- a/Application/Admin/Controller/BehaviorLogController.class.php +++ b/Application/Admin/Controller/BehaviorLogController.class.php @@ -130,13 +130,13 @@ class BehaviorLogController extends ThinkController $show_data = []; foreach($data as $k => $v) { if($v['tab'] == 'spend') { - $order_detail = M('spend', 'tab_')->field('order_number,pay_time,user_account,promote_account,game_name,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); + $order_detail = M('spend', 'tab_')->field('extend,pay_time,user_account,promote_account,game_name,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); $re_data['pay_time'] = $order_detail['pay_time']; } elseif($v['tab'] == 'deposit') { $order_detail = M('deposit', 'tab_')->field('order_number,create_time,user_account,promote_account,pay_amount,pay_way')->where(['pay_order_number' => $v['pay_order_number']])->find(); $re_data['pay_time'] = $order_detail['create_time']; } - $re_data['order_number'] = !empty($order_detail['order_number']) ? $order_detail['order_number'] : '-'; + $re_data['order_number'] = isset($order_detail['extend']) ? $order_detail['extend'] : '-'; $re_data['user_account'] = $order_detail['user_account']; $re_data['promote_account'] = $order_detail['promote_account']; $re_data['game_name'] = !empty($order_detail['game_name']) ? $order_detail['game_name'] : '-';