From e1fd669aa8f80d54ae3c782019c1ed58269cbbc7 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 7 Nov 2019 11:56:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0->?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86->=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95->=E7=BB=93=E7=AE=97=E5=8D=95--=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/FinanceController.class.php | 52 ++++- .../View/default/Finance/settlementOrder.html | 200 ++++++++++++++++++ .../View/default/Finance/withdrawDtl.html | 19 +- .../View/default/Finance/withdrawRecord.html | 8 +- 4 files changed, 267 insertions(+), 12 deletions(-) create mode 100644 Application/Home/View/default/Finance/settlementOrder.html diff --git a/Application/Home/Controller/FinanceController.class.php b/Application/Home/Controller/FinanceController.class.php index 080955c5f..5ae5a619d 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -365,12 +365,10 @@ class FinanceController extends BaseController if (isset($_GET['status']) && $_GET['status'] !== '') { $status = intval($_GET['status']); if (!isset(FinanceController::$withdrawStatus[$status])) { - if (!isset(FinanceController::$withdrawStatus[$status])) { - $this->error('参数异常'); - } - - $map['status'] = $status; + $this->error('参数异常'); } + + $map['status'] = $status; } $data = $model->field('id,widthdraw_number,create_time,settlement_end_time,sum_money,status,respond') @@ -485,4 +483,48 @@ class FinanceController extends BaseController $this->assign('modelList', $modelList); $this->display(); } + + //结算单 + public function settlementOrder() + { + //是否是会长 + $this->purview(); + //验证安全密码 + $metaTitle = '结算单'; + $modelList = ['财务管理', '提现记录', $metaTitle]; + $this->verifyPasswordView($modelList); + + $model = M('withdraw', 'tab_'); + $withdrawId = intval(I('get.id', 0)); + if ($withdrawId == 0) { + $this->error('参数异常'); + } + $withdraw = $model->find($withdrawId); + if (empty($withdraw) || $withdraw['promote_id'] != $this->loginPromote['id']) { + $this->error('参数异常'); + } + $withdraw['create_time'] = date('Y-m-d H:i:s', $withdraw['create_time']); + $withdraw['settlement_end_time'] = date('Y-m-d H:i:s', $withdraw['settlement_end_time']); + $withdraw['status'] = FinanceController::$withdrawStatus[$withdraw['status']]; + + $map['withdraw_id'] = $withdrawId; + $data = M('spend', 'tab_') + ->field('game_name,selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income') + ->where($map) + ->group('game_id') + ->order('game_id') + ->select(); + if (!empty($data)) { + foreach ($data as &$list) { + $list['income'] = bcdiv($list['income'], 100, 2); + } + } + + $this->assign('withdraw', $withdraw); + $this->assign('listData', $data); + $this->assign('promoteData', $this->loginPromote); + $this->assign('meta_title', $metaTitle); + $this->assign('modelList', $modelList); + $this->display(); + } } \ No newline at end of file diff --git a/Application/Home/View/default/Finance/settlementOrder.html b/Application/Home/View/default/Finance/settlementOrder.html new file mode 100644 index 000000000..16dfbf387 --- /dev/null +++ b/Application/Home/View/default/Finance/settlementOrder.html @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Application/Home/View/default/Finance/withdrawDtl.html b/Application/Home/View/default/Finance/withdrawDtl.html index 851cf4510..b7b1273e5 100644 --- a/Application/Home/View/default/Finance/withdrawDtl.html +++ b/Application/Home/View/default/Finance/withdrawDtl.html @@ -135,8 +135,11 @@ 玩家账号 订单总额 现金分成基数 + 现金分成比例 平台币分成基数 - 平台币分成比例(直充|内充) + 平台币分成比例 + 绑定币分成基数 + 绑定币分成比例 现金支付通道 收益 订单状态 @@ -157,14 +160,24 @@ {:getSDKTypeName($vo['sdk_version'])} {$vo.user_account} {$vo.pay_amount} - + + {$vo.pay_amount} + 0 + + {$vo.selle_ratio}% + {$vo.pay_amount} + 0 + + {$vo.selle_ratio}% + {$vo.pay_amount} + 0 - {$vo.selle_ratio}%|{$vo.selle_ratio}% + {$vo.selle_ratio}% {$vo.pay_way_name} {$vo.income} {$status} diff --git a/Application/Home/View/default/Finance/withdrawRecord.html b/Application/Home/View/default/Finance/withdrawRecord.html index 1685883b6..284b914bf 100644 --- a/Application/Home/View/default/Finance/withdrawRecord.html +++ b/Application/Home/View/default/Finance/withdrawRecord.html @@ -98,13 +98,13 @@
- +
- +
- +
@@ -172,7 +172,7 @@ 提现明细 汇款证明 - 结算单 + 结算单 From 115bafc067b035a96a74f5e3156f5cb373166f41 Mon Sep 17 00:00:00 2001 From: chenzhi <“chenzhi063@qq.com> Date: Thu, 7 Nov 2019 12:00:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A5=E9=93=BE?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E5=8F=8A=E5=8F=96=E6=B6=88=E8=A1=A5=E9=93=BE?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/MendController.class.php | 83 +++++---- Application/Admin/View/Mend/edit.html | 8 +- Application/Admin/View/Mend/lists.html | 9 +- Application/Admin/View/Mend/shiftInfo.html | 173 ++++++++++++++++++ Application/Common/Common/extend.php | 20 ++ Data/update.sql | 5 +- 6 files changed, 257 insertions(+), 41 deletions(-) create mode 100644 Application/Admin/View/Mend/shiftInfo.html diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index df3846a4c..a1d9bc50f 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -58,9 +58,9 @@ class MendController extends ThinkController { public function edit($id = null) { - // $promoteService = new PromoteService(); - + if (IS_POST) { + $promoteService = new PromoteService(); if ($_POST['prmoote_id_to'] == -1){ $_POST['prmoote_id_to'] = 0; } @@ -70,44 +70,27 @@ class MendController extends ThinkController { if ($_POST['promote_id'] == $_POST['prmoote_id_to']) { $this->error('没有变更数据'); } + if ($_POST['order_time'] == '') { + $this->error('没有订单日期'); + } $create = $_REQUEST; - dump($create); - $map['id'] = $create['user_id']; - $map_['user_id'] = $create['user_id']; - $data['promote_id'] = $create['prmoote_id_to']; - $data['promote_account'] = get_promote_name($create['prmoote_id_to']); -// 加入补链时间 - $data['rebind_time'] = $create['rebind_time']; - dump($data); - $user_data = $data; - $promote = M('promote', 'tab_')->where(array("id"=>I('prmoote_id_to')))->find(); - if ($promote['parent_id'] != "0") { - $ppromote = M('promote', 'tab_')->where(array("id"=>$promote['parent_id']))->find(); - $user_data['parent_id']=$ppromote['id']; + $create['order_time'] = date($create['order_time']); + $params = array( + "from_promote_id"=>$create['promote_id'], + "to_promote_id"=>$create['prmoote_id_to'], + "order_time"=>$create['order_time'], + "type"=>2, + "shift_ids"=>[$create['user_id']], + ); + if(!empty($create['remark'])){ + $params['remark'] = $create['remark']; + } + $res = $promoteService->addShiftTask($params); + if($res['status']){ + $this->success('补链成功', U('lists'), 2); }else{ - $user_data['parent_id'] = 0; + $this->error($res['msg']); } - - $user_data['parent_name']=get_promote_name($user_data['parent_id']); - - // $user = M('user', 'tab_')->where($map)->save($user_data); - // $user_ = M('UserPlay', 'tab_')->where($map_)->save($data); - // $puser_ = M('UserPlayInfo', 'tab_')->where($map_)->save($data); - // $spend = M('Spend', 'tab_')->where($map_)->where(array('is_check'=>array('in','1,2')))->save($data);// spend只改未对账的数据 - // $depost = M('Deposit', 'tab_')->where($map_)->save($data); - // $Bind_spend = M('Bind_spend', 'tab_')->where($map_)->save($data); - // $create['user_account'] = get_user_account($create['user_id']); - // $create['promote_account'] = get_promote_name($create['promote_id']); - // $create['promote_id_to'] = $create['prmoote_id_to']; - // $create['promote_account_to'] = get_promote_name($create['prmoote_id_to']); - // $create['create_time'] = time(); - // $create['op_id'] = UID; - // $create['op_account'] = session('user_auth.username'); - // $create['bind_type'] = $create['bind_type']; - // $mend = M('mend', 'tab_')->add($create); - // if ($mend) { - // $this->success('补链成功', U('lists'), 2); - // } } else { $user = A('User', 'Event'); $user_data = $user->user_entity($id); @@ -123,6 +106,30 @@ class MendController extends ThinkController { $this->display(); } } + //补链详情 + public function shiftInfo() + { + $id = I('id'); + $info = M("shift_task")->where("id = {$id} and status = 0")->find(); + if(empty($info)){ + $this->error("补链不存在或已处理"); + } + - + $info['user_id'] = json_decode($info['shift_ids'])[0]; + $info['order_time'] = date("Y-m-d",$info['order_time']); + $this->assign('data',$info); + $this->display(); + } + //取消补链 + public function cancelShift() + { + $id = I('id'); + $status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]); + if ($status) { + $this->success('取消补链成功', U('lists'), 2); + } else { + $this->error("取消失败,或补链已生效",U('lists')); + } + } } diff --git a/Application/Admin/View/Mend/edit.html b/Application/Admin/View/Mend/edit.html index 38821314b..b1d310b39 100644 --- a/Application/Admin/View/Mend/edit.html +++ b/Application/Admin/View/Mend/edit.html @@ -84,6 +84,13 @@ + + 订单日期: + + + + + 换绑类型 @@ -159,7 +166,6 @@ Think.setValue("prmoote_id_to", {$data.promote_id|default = "''"}); $('#submit').click(function(){ $('#form').submit(); }); - $(function(){ $('.time').datetimepicker({ format: 'yyyy-mm-dd hh:ii', diff --git a/Application/Admin/View/Mend/lists.html b/Application/Admin/View/Mend/lists.html index 2c133330f..2e87bce63 100644 --- a/Application/Admin/View/Mend/lists.html +++ b/Application/Admin/View/Mend/lists.html @@ -80,7 +80,14 @@ {:get_promote_name($data['promote_id'])}
- 补链 + + + 补链 + + 补链中 + + + diff --git a/Application/Admin/View/Mend/shiftInfo.html b/Application/Admin/View/Mend/shiftInfo.html new file mode 100644 index 000000000..dd6f0f9a8 --- /dev/null +++ b/Application/Admin/View/Mend/shiftInfo.html @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
用户账号 + +
修改前渠道 + + +
补链后渠道 + + +
订单日期: + +
换绑类型 + In + Out +
备注 + + +
+ + +
+ + + 返回 + +
+ +
+ + + + +
+ + + +if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + diff --git a/Application/Common/Common/extend.php b/Application/Common/Common/extend.php index 0e0b103f4..f0acd5aa7 100644 --- a/Application/Common/Common/extend.php +++ b/Application/Common/Common/extend.php @@ -2834,3 +2834,23 @@ function index_by_column($column, $items) } return $records; } + +/** + * [获取用户是否补链中] + * @param integer $user_id [description] + * @return bool + */ +function getIsTask($user_id){ + + $shift = M("shift_task"); + $map=array( + "status"=>0, + "shift_ids"=>array("LIKE","%\"{$user_id}\"%") + ); + $shiftres = $shift->field("id")->where($map)->find(); + if(empty($shiftres)){ + return 0; + }else{ + return $shiftres['id']; + } +} diff --git a/Data/update.sql b/Data/update.sql index ffb537dea..a46614f99 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -338,4 +338,7 @@ CREATE TABLE `tab_spend_user_count` ( -- 2019-11-6 cxj ALTER TABLE `tab_spend` ADD COLUMN `withdraw_id` int(11) NOT NULL DEFAULT 0 COMMENT '提现ID' AFTER `pay_url`; -ALTER TABLE `tab_withdraw` ADD COLUMN `settlement_end_time` int(10) NOT NULL DEFAULT 0 COMMENT '结算截止时间' AFTER `old_promote_account`; \ No newline at end of file +ALTER TABLE `tab_withdraw` ADD COLUMN `settlement_end_time` int(10) NOT NULL DEFAULT 0 COMMENT '结算截止时间' AFTER `old_promote_account`; + + +INSERT INTO `sys_menu` (`title`, `pid`, `sort`, `url`, `hide`, `tip`, `group`, `is_dev`, `status`) VALUES ('补链详情', '192', '0', 'Mend/shiftInfo', '0', '', '推广补链', '0', '1'); From a29015937ab88fd73841b14e73d89065159d7eea Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Thu, 7 Nov 2019 12:05:45 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=90=8E=E5=8F=B0->?= =?UTF-8?q?=E8=B4=A2=E5=8A=A1=E7=AE=A1=E7=90=86->=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E8=AE=B0=E5=BD=95->=E7=BB=93=E7=AE=97=E5=8D=95--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= 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 5ae5a619d..f90f42549 100644 --- a/Application/Home/Controller/FinanceController.class.php +++ b/Application/Home/Controller/FinanceController.class.php @@ -509,7 +509,7 @@ class FinanceController extends BaseController $map['withdraw_id'] = $withdrawId; $data = M('spend', 'tab_') - ->field('game_name,selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income') + ->field('game_name,if(selle_ratio >= 0,selle_ratio,0) as selle_ratio,pay_way,sum(pay_amount) as pay_amount_all,sum(if(selle_ratio > 0,pay_amount * selle_ratio,0)) as income') ->where($map) ->group('game_id') ->order('game_id')