From 5107fb9b326b4fe19dcca95af47ca2b81785e5bc Mon Sep 17 00:00:00 2001 From: chenzhi Date: Tue, 7 Dec 2021 17:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B3=A8=E9=94=80=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CloseAccountController.class.php | 132 ++++++++ Application/Admin/View/CloseAccount/list.html | 303 ++++++++++++++++++ 2 files changed, 435 insertions(+) create mode 100644 Application/Admin/Controller/CloseAccountController.class.php create mode 100644 Application/Admin/View/CloseAccount/list.html diff --git a/Application/Admin/Controller/CloseAccountController.class.php b/Application/Admin/Controller/CloseAccountController.class.php new file mode 100644 index 000000000..9f4232b6b --- /dev/null +++ b/Application/Admin/Controller/CloseAccountController.class.php @@ -0,0 +1,132 @@ +"未审核", + 1=>"审核通过", + 2=>"撤销申请", + ]; + public $admininfo; + public $DBModel; + public function _initialize() + { + $this->admininfo = $_SESSION['onethink_admin']['user_auth']; + $this->DBModel = M("close_account_log","tab_"); + parent::_initialize(); + } + public function list() + { + $page = I('p', 1); + $row = I('row', 10); + if(isset($_REQUEST['account'])){ + $map['account']=array('like','%'.trim($_REQUEST['account']).'%'); + } + if(isset($_REQUEST['user_id'])){ + $map['user_id']=trim($_REQUEST['user_id']); + } + if(isset($_REQUEST['phone'])){ + $map['phone']=$_REQUEST['phone']; + } + if(isset($_REQUEST['status'])){ + $map['status']= $_REQUEST['status']; + } + + if (isset($_REQUEST['time_start']) && isset($_REQUEST['time_end'])) { + $time_start = strtotime($_REQUEST['time_start']); + $time_end = strtotime($_REQUEST['time_end'])+ 86399; + $map["_string"] = "(create_time BETWEEN {$time_start} AND {$time_end})"; + } elseif (isset($_REQUEST['time_start'])) { + $time_start = strtotime($_REQUEST['time_start']); + $map["_string"] = "(create_time >= {$time_start} )"; + } elseif (isset($_REQUEST['time_end'])) { + $time_end = strtotime($_REQUEST['time_end'])+ 86399; + $map["_string"] = "(create_time <= {$time_end} )"; + } + + $data = $this->DBModel->where($map)->order("create_time desc")->page($page, $row)->select(); + + if($data){ + $game = M("game","tab_")->where(['id'=>["in",array_column($data,'game_id')]])->getField("id,game_name",true); + $admin = M("member")->where(['uid'=>["in",array_column($data,'admin_id')]])->getField("uid,nickname",true); + foreach ($data as $k => &$v) { + $v['game_name'] = $game[$v['game_id']] ?? "--"; + $v['admin_name'] = $admin[$v['admin_id']] ?? "--"; + $v['create_time'] = date("Y-m-d H:i:s",$v['create_time']); + $v['update_time'] = $v['update_time'] ? date("Y-m-d H:i:s",$v['update_time']) : '--'; + $v['status_str'] = $this->STATUS[$v['status']] ?? "--"; + } + } + $count = $this->DBModel->where($map)->count(); + $page = set_pagination($count, $row); + if ($page) { + $this->assign('_page', $page); + } + + $Rule = strtolower(MODULE_NAME . '/' . CONTROLLER_NAME . '/check'); + if ($this->checkRule($Rule, array('in', '1,2')) || IS_ROOT) { + $this->assign("check",true); + } + $this->assign("data",$data); + $this->display(); + } + + + public function check(){ + + $status = $_REQUEST['status']; + $ids = $_REQUEST['ids']; + if (!$ids) { + $this->ajaxReturn(['status'=>0,'msg'=>'数据错误']); + } + $userIds = $this->DBModel->where(['id'=>['in',$ids],'status'=>0])->getField('user_id',true); + + if($status == 1){ + $this->closeAccount($userIds); + } + if($status == 2){ + $this->cancel($userIds); + } + $this->resetCloseAccount($ids,$status); + + $this->ajaxReturn(['status'=>1,'msg'=>'操作成功']); + + } + private function closeAccount($userIds) + { + $userBase = [ + 'lock_status'=>0, + 'lock_remark'=>"用户注销锁定", + 'phone'=>'' + ]; + $userDB = M('user',"tab_"); + foreach ($userIds as $k => $v) { + $userBase['account'] = "zxzh".substr(md5($v.time()),8,16); + $userBase['id'] = $v; + $userDB->save($userBase); + } + } + private function cancel($userIds) + { + $userBase = [ + 'lock_status'=>1, + 'lock_remark'=>"", + 'id'=>['in',$userIds] + ]; + M('user',"tab_")->save($userBase); + } + private function resetCloseAccount($ids,$status) + { + $base = [ + 'status'=>$status, + 'id'=>['in',$ids], + 'admin_id'=>$this->admininfo['uid'], + 'update_time'=>time(), + ]; + $this->DBModel->save($base); + } + + +} \ No newline at end of file diff --git a/Application/Admin/View/CloseAccount/list.html b/Application/Admin/View/CloseAccount/list.html new file mode 100644 index 000000000..2f0e21146 --- /dev/null +++ b/Application/Admin/View/CloseAccount/list.html @@ -0,0 +1,303 @@ + + + + + + + + + + + +
+ + +
+
+   +
+
+   +
+ +
+ +
+ +
+ +  -  +
+ + +
+
+ +
+ 搜索 +
+
+
+
+ +
+ + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
玩家账号账号ID手机号码游戏申请注销时间审核日期审核人审核状态
aOh! 暂时还没有内容!
{$data.account}{$data.user_id}{$data.phone}{$data.game_name}{$data.create_time}{$data.update_time}{$data.admin_name}{$data.status_str}
+
+
+
+
+ {$_page|default=''} +
+ +
+ + + + + + if(C('COLOR_STYLE')=='blue_color') echo ''; + + + + + +