From c6b8f99b6e95682bf02828f861f5cc3e805ffd4d Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Sat, 21 Dec 2019 14:15:44 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=9D=9E=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A0=E5=AF=86=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/MemberController.class.php | 23 ++++++++- Application/Admin/View/Member/edit.html | 49 ++++++++++++++++--- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index aa45e178b..9166e73c7 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -3,6 +3,7 @@ namespace Admin\Controller; use Sdk\Controller\AgeController; +use Think\Log; use User\Api\MemberApi as MemberApi; use Org\WeixinSDK\Weixin; @@ -937,11 +938,31 @@ class MemberController extends ThinkController } } + + public function changeprelname() + { + if (preg_match('/^([\xe4-\xe9][\x80-\xbf]{2}){2,4}$/', $_POST['real_name'])) { + //重复判断 + $map['id'] = $_POST['id']; + $pro = M("User", "tab_") + ->where($map) + ->setField('real_name', $_POST['real_name']); + if ($pro !== false) { + $this->ajaxReturn(array("status" => 1, "msg" => "真实姓名修改成功")); + } else { + $this->ajaxReturn(array("status" => 0, "msg" => "真实姓名修改失败")); + } + } else { + $this->ajaxReturn(array("status" => 0, "msg" => "真实姓名输入错误")); + } + } + + public function changepidcard() { if (preg_match('/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/', $_POST['idcard'])) { //重复判断 - $where['idcard'] = $_POST['idcard']; + //$where['idcard'] = $_POST['idcard']; /*$user = M('User', 'tab_')->where($where)->field('id,account')->find(); if ($user) { $this->ajaxReturn(array("status" => 0, "msg" => "该身份证号码已被" . $user['account'] . "(" . $user['id'] . ")绑定")); diff --git a/Application/Admin/View/Member/edit.html b/Application/Admin/View/Member/edit.html index 62dd12e68..2bae45352 100644 --- a/Application/Admin/View/Member/edit.html +++ b/Application/Admin/View/Member/edit.html @@ -99,19 +99,21 @@ 未成年 意外数据 - - - 需玩家认证真实姓名和身份证号码 - + 需玩家认证真实姓名和身份证号码 真实姓名 - + - + + + + + + 点击修改 @@ -366,6 +368,41 @@ }); }); + $("#relname").click(function () { + layer.prompt({ + formType: 3, + title: "请输入真实姓名", + value: '' + }, function (real_name) { + var jsid = $('#selfid').val(); + var realName = /^[\u4E00-\u9FA5]{2,4}$/; + if(!realName.test(real_name)){ + layer.msg("真实姓名填写有误"); + return false; + } + $.ajax({ + url: '{:U("changeprelname")}', + type: 'post', + dataType: 'json', + data: {real_name:real_name,id:jsid}, + success: function (data) { + if (data.status > 0) { + layer.msg(data.msg); + setTimeout(function(){ + self.location.reload(true); + },1500); + + } else { + layer.msg(data.msg) + } + }, + error: function () { + alert("服务器故障!"); + } + }); + }); + }); + $("#idcard").click(function () { layer.prompt({ formType: 3, From 1ca183b5470f63237054903a3ffc3b5489ca1fe8 Mon Sep 17 00:00:00 2001 From: zhengchanglong Date: Sat, 21 Dec 2019 14:41:20 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=9D=9E=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8A=A0=E5=AF=86=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BehaviorLogController.class.php | 1 + Application/Admin/View/BehaviorLog/index.html | 154 ++++++++++-------- 2 files changed, 84 insertions(+), 71 deletions(-) diff --git a/Application/Admin/Controller/BehaviorLogController.class.php b/Application/Admin/Controller/BehaviorLogController.class.php index 01a43b416..79fc6c29e 100644 --- a/Application/Admin/Controller/BehaviorLogController.class.php +++ b/Application/Admin/Controller/BehaviorLogController.class.php @@ -78,6 +78,7 @@ class BehaviorLogController extends ThinkController $this->assign('startDate', $startDate); $this->assign('endDate', $endDate); $this->assign('data', $data); + $this->assign("is_admin",is_administrator()); $this->display('index'); } diff --git a/Application/Admin/View/BehaviorLog/index.html b/Application/Admin/View/BehaviorLog/index.html index e97c61afd..39a87c998 100644 --- a/Application/Admin/View/BehaviorLog/index.html +++ b/Application/Admin/View/BehaviorLog/index.html @@ -7,24 +7,24 @@ @@ -37,7 +37,7 @@
- +
@@ -63,14 +63,14 @@ - +
+
- - - 已添加添加至常用设置 -
+ @@ -197,7 +209,7 @@ @@ -418,8 +430,8 @@ dataType:'json', success:function(response){ str = '' + - // '' + - ''; + // '' + + ''; data = response.data; for (var i in data){ str += "" @@ -432,29 +444,29 @@ }); $("#promote_level").change(); - var game_server = "{:I('server_name')}"; - $("#sdk_version").change(function(){ - $.ajax({ - url:"{:U('Ajax/getGmeServer')}", - type:"post", - data:{sdk_version:$("#sdk_version option:selected").val(), game_name:$("#game_name option:selected").val()}, - dataType:'json', - success:function(data){ - str = ""; - for (var i in data){ - str += "" - } - $("#server_name").empty(); - $("#server_name").append(str); - $("#server_name").select2(); + var game_server = "{:I('server_name')}"; + $("#sdk_version").change(function(){ + $.ajax({ + url:"{:U('Ajax/getGmeServer')}", + type:"post", + data:{sdk_version:$("#sdk_version option:selected").val(), game_name:$("#game_name option:selected").val()}, + dataType:'json', + success:function(data){ + str = ""; + for (var i in data){ + str += "" } - }) - }); + $("#server_name").empty(); + $("#server_name").append(str); + $("#server_name").select2(); + } + }) + }); - $("#game_name").change(function(){ - $("#sdk_version").change(); - }); - $("#game_name").change(); + $("#game_name").change(function(){ + $("#sdk_version").change(); + }); + $("#game_name").change(); /** * 初始化select2单选,默认带搜索功能。 From 86dd4a295296c76d91b55abbef1964d615f4e836 Mon Sep 17 00:00:00 2001 From: liuweiwen <“529520975@qq.com> Date: Sat, 21 Dec 2019 15:31:12 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90=E7=94=A8=E6=88=B7=E3=80=91-?= =?UTF-8?q?=E3=80=90=E7=8E=A9=E5=AE=B6=E7=BB=84=E3=80=91-=E3=80=90?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=AE=B0=E5=BD=95=E3=80=91-=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E4=BC=9A=E9=95=BF=E5=8F=AA=E6=98=BE=E7=A4=BA=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E4=BC=9A=E9=95=BF=E7=9A=84=E7=99=BB=E5=BD=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=20=E6=94=B9=E4=B8=BA=E5=B1=95=E7=A4=BA=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E4=BC=9A=E9=95=BF=E5=8F=8A=E5=85=B6=E6=89=80=E5=B1=9E?= =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98=E7=9A=84=E7=99=BB=E5=BD=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Common/extend.php | 34 ++++++++++++++----- .../Controller/MemberController.class.php | 13 +++++-- .../Admin/View/Member/device_bans_list.html | 4 --- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index e4832f814..e720bc776 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -44,16 +44,11 @@ function get_promote_list_by_id($id=0) { if(is_numeric($id) && $id>=0) { $map['parent_id'] = $id; - $list = $query->where($map)->select(); } elseif(is_array($id)) { $map['parent_id'] = array('in',$id); - $list = $query->where($map)->select(); - } elseif(is_numeric($id) && $id<0){ - $list = $query->where($map)->select(); - } else { - $list = ''; } - return $list; + $list = $query->where($map)->select(); + return $list; } /* @@ -1590,7 +1585,7 @@ function getPowerPromoteIds() if ($myPromote_ids) { if ($userAuth['data_empower_type'] == 2) {//部分会长加上自己创建的会长 - $userAuth['data_president'] .= "," . $myPromote_ids; +// $userAuth['data_president'] .= "," . $myPromote_ids; } elseif ($userAuth['data_empower_type'] == 3) {//自己创建的会长和底下推广员 $userAuth['data_president'] = $myPromote_ids; } @@ -1619,11 +1614,17 @@ function getPowerPromoteIds() return $promoteIds; } +/** + * 为数据权限添加筛选参数 + * @param array $map 查询条件 + * @param string $column 字段名,默认为promote_id + * @return mixed + */ function setPowerPromoteIds(&$map, $column = 'promote_id') { //为数据权限添加 $promoteIds = getPowerPromoteIds(); if (empty($promoteIds)) { - $map[$column] = -1; + $map[$column] = -1;//没权限时将promote_id置为-1 } elseif ($promoteIds != 'all') { if (isset($map[$column])) { if (isset($map['_string'])) {//查询字段中已存在promote_id,不覆盖此条件而处理 @@ -1697,4 +1698,19 @@ function get_admin_listOther() if(empty($list)){return false;} return $list; } + +/** + * 根据会长id底下的推广员id + * @param $promote_id + * @return mixed + */ +function getOffspringByPromoteId($promote_id) { + $promote_ids = M('promote', 'tab_') + ->where(['chain' => ['like', "%/{$promote_id}/%"]]) + ->field('group_concat(id) as promote_ids') + ->find(); + return $promote_ids['promote_ids']; +} + + ?> diff --git a/Application/Admin/Controller/MemberController.class.php b/Application/Admin/Controller/MemberController.class.php index 9166e73c7..fd6c8a73c 100644 --- a/Application/Admin/Controller/MemberController.class.php +++ b/Application/Admin/Controller/MemberController.class.php @@ -1070,17 +1070,26 @@ class MemberController extends ThinkController setPowerPromoteIds($map,'promote_id'); if (isset($_REQUEST['promote_id'])) { - $map['promote_id'] = $_REQUEST['promote_id']; + if (I('promote_level') ==1) { + $promote_ids = getOffspringByPromoteId($_REQUEST['promote_id']); + if (empty($promote_ids)) { + $promote_ids = -1; + } + $map['promote_id'] = ['exp', "in($promote_ids)"]; + } else { + $map['promote_id'] = $_REQUEST['promote_id']; + } unset($_REQUEST['promote_id']); } + // $map['type'] = 1; // $map['login_time'] = ['exp', 'login_time<>0']; $extend = array(); $extend['map'] = $map; $count = M('UserLoginRecord','tab_')->field('user_id')->where($extend['map'])->group('user_id')->select(false); $sql = "select count(user_id) as count from ({$count})t"; + $count = M('UserLoginRecord','tab_')->query($sql); -// var_dump($sql);die(); $this->m_title = '登录记录'; $this->assign('user_count',$count[0]['count']); diff --git a/Application/Admin/View/Member/device_bans_list.html b/Application/Admin/View/Member/device_bans_list.html index 62730c29c..6e4686a3e 100644 --- a/Application/Admin/View/Member/device_bans_list.html +++ b/Application/Admin/View/Member/device_bans_list.html @@ -25,10 +25,6 @@ height:26px;line-height:26px;font-size:12px; } .select2-results__option[aria-selected] {font-size:12px;} - .select2-dropdown { - z-index: 1; - } -