From fc9fa629aee915084aa1c09b83b1a4ebc2a3ece5 Mon Sep 17 00:00:00 2001 From: zyx Date: Sun, 22 Mar 2020 22:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=85=85=E5=80=BCbug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UserPayWhiteListController.class.php | 126 ++++ .../Admin/View/UserPayWhiteList/add.html | 131 ++++ .../Admin/View/UserPayWhiteList/index.html | 659 ++++++++++++++++++ 3 files changed, 916 insertions(+) create mode 100644 Application/Admin/Controller/UserPayWhiteListController.class.php create mode 100644 Application/Admin/View/UserPayWhiteList/add.html create mode 100644 Application/Admin/View/UserPayWhiteList/index.html diff --git a/Application/Admin/Controller/UserPayWhiteListController.class.php b/Application/Admin/Controller/UserPayWhiteListController.class.php new file mode 100644 index 000000000..b9e551ae7 --- /dev/null +++ b/Application/Admin/Controller/UserPayWhiteListController.class.php @@ -0,0 +1,126 @@ +where($map) + ->page($page,$row) + ->select(); + + foreach ($data as $key => $value) { + if ($value['status']==2) { + $data[$key]['time_status'] = '永久'; + } else { + $data[$key]['time_status'] = '有效期至'.date('Y-m-d H:i:s',$value['update_time']+$value['time']); + } + + $data[$key]['update_time'] = date('Y-m-d H:i:s',$value['update_time']); + + } + + $count = M('user_pay_whitelist','tab_')->where($map)->count(); + + $this->assign('data',$data); + + $page = set_pagination($count,$row); + if($page) {$this->assign('_page', $page);} + } + + $this->assign('data',$data); + $this->meta_title = '玩家支付限制白名单'; + + $this->display(); + + } + + public function add() { + + if (IS_POST) { + + $post = $_POST; + + if($post['account']!=$post['account_check']) { + $this->ajaxReturn(['status'=>0,'msg'=>'两次输入不一致']); + exit(); + } + + $hav_user = M('user','tab_')->where(['account'=>$post['account']])->find(); + + if(!$hav_user) { + $this->ajaxReturn(['status'=>0,'msg'=>'账号不存在']); + exit(); + } + + $whiteList = M('user_pay_whitelist','tab_')->where(['user_id'=>$hav_user['id']])->find(); + + $insert = []; + + $insert['user_id'] = $hav_user['id']; + $insert['user_account'] = $hav_user['account']; + + if(!$whiteList) { + + $insert['status'] = 0; + $insert['time'] = 7*86400; + $insert['create_time'] = time(); + $insert['update_time'] = time(); + + $is_success = M('user_pay_whitelist','tab_')->add($insert); + + } else { + $insert['update_time'] = time(); + if($whiteList['status']==0) { + $insert['status'] = 1; + $insert['time'] = 30*86400; + } elseif($whiteList['status']==1) { + $insert['status'] = 2; + $insert['time'] = 1; + + } + + if($whiteList['sstatus']==2) { + $this->ajaxReturn(['status'=>0,'msg'=>'该账号已经是永久无需再进行操作']); + exit(); + } + + $is_success = M('user_pay_whitelist','tab_')->where(['user_id'=>$hav_user['id']])->save($insert); + } + + if($is_success) { + $this->ajaxReturn(['status'=>1,'msg'=>'操作成功']); + exit(); + } else { + $this->ajaxReturn(['status'=>0,'msg'=>'操作失败']); + exit(); + } + + } + + $this->meta_title = '新增支付限制白名单账号'; + + $this->display(); + + } + + + +} diff --git a/Application/Admin/View/UserPayWhiteList/add.html b/Application/Admin/View/UserPayWhiteList/add.html new file mode 100644 index 000000000..90db5feb0 --- /dev/null +++ b/Application/Admin/View/UserPayWhiteList/add.html @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + + +
账号: + + +
账号确认: + + +
+
+ +
+ + + 返回 + +
+
+
+
+ + + +
+ + + + + + + diff --git a/Application/Admin/View/UserPayWhiteList/index.html b/Application/Admin/View/UserPayWhiteList/index.html new file mode 100644 index 000000000..4ed00da2b --- /dev/null +++ b/Application/Admin/View/UserPayWhiteList/index.html @@ -0,0 +1,659 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
序号账号状态有效时间时间操作
aOh! 暂时还没有内容!
+ {$data.id}{$data.user_account}7天允许支付30天允许支付永久允许支付下游个人结算单{$data.time_status}{$data.update_time}
+
+ +
+
+
+ + 导出 + + {$_page|default=''} +
+ + +
+ + + + if(C('COLOR_STYLE')=='blue_color') echo ' + + '; + + + + + + + + + +