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] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A5=E9=93=BE=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E5=8F=8A=E5=8F=96=E6=B6=88=E8=A1=A5=E9=93=BE=E5=8A=9F?= =?UTF-8?q?=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 @@ +
说明:此处功能用于修改玩家所属推广渠道的功能。
+用户账号 | ++ + | +
修改前渠道 | ++ + + | +
补链后渠道 | ++ + + | +
订单日期: | ++ + | +
换绑类型 | ++ In + Out + | +
备注 | ++ + + | +