Merge branch 'release-1.0.0' of 47.111.118.107:wmtx/platform into release-1.0.0

master
chenzhi 5 years ago
commit 624e321b70

@ -44,15 +44,10 @@ 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 = '';
}
$list = $query->where($map)->select();
return $list;
}
@ -1590,7 +1585,8 @@ 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;
}
@ -1598,6 +1594,7 @@ function getPowerPromoteIds()
if (!empty($userAuth['data_president'])) {//查询有权限查看的会长以及底下的推广员
$map = array();
//查询会长底下的推广员(首个斜杆之间的数字)
$userAuth['data_president']= trim($userAuth['data_president'], ",");
$where['SUBSTRING_INDEX(SUBSTRING_INDEX(`chain`,"/",2),"/",-1)'] = array('exp',"IN({$userAuth['data_president']})");
$where['id'] = array('in', $userAuth['data_president']);//会长本身
$where['_logic'] = 'or';
@ -1619,11 +1616,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 +1700,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'];
}
?>

@ -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');
}

@ -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'] . ")绑定"));
@ -1049,17 +1070,26 @@ class MemberController extends ThinkController
setPowerPromoteIds($map,'promote_id');
if (isset($_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']);

@ -224,7 +224,7 @@ class PromoteController extends ThinkController
session('user_auth_promote_ids', null);
$this->success("添加成功", U('lists'));
} else {
$this->error($res);
$this->error('添加失败');
}
} else {
$this->meta_title ='新增渠道信息';

@ -139,10 +139,22 @@
<tr>
<td>{$vo.extend}</td>
<td>{:set_show_time($vo['create_time'])}</td>
<td>{$vo.user_account}</td>
<td>
<if condition="$is_admin eq true ">
{$vo.user_account}
<else />
{$vo.user_account|encryptStr}
</if>
</td>
<td>{$vo.game_name}</td>
<td>{$vo.server_name}</td>
<td>{$vo.promote_account}</td>
<td>
<if condition="$is_admin eq true ">
{$vo.promote_account}
<else />
{$vo.promote_account|encryptStr}
</if>
</td>
<td>{$vo.game_player_id}</td>
<td>{$vo.game_player_name}</td>
<td>{$vo.price}</td>

@ -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;
}
</style>
<!-- 标题栏 -->
<div class="cf main-place top_nav_list navtab_list">

@ -99,19 +99,21 @@
<case value="3">未成年</case>
<default />意外数据
</switch>
</span>
<span class="notice-text">需玩家认证真实姓名和身份证号码</span>
</td>
</span><span class="notice-text">需玩家认证真实姓名和身份证号码</span></td>
</tr>
<tr>
<td class="l">真实姓名</td>
<td class="r">
<if condition="$data['real_name'] eq null">
<input type="text" class="txt" name="real_name" value="">
<input type="text" class="txt" value="" readonly>
<else/>
<if condition="$is_admin eq true ">
<input type="text" class="txt" value="{$data['real_name']}" readonly>
<else />
<input type="text" class="txt" name="real_name" value="{$data['real_name']}">
<input type="text" class="txt" value="{$data['real_name']|encryptRealName}" readonly>
</if>
</if>
<span id="relname" class="table_click"><span class="table_click_text inner-click-text">点击修改</span></span>
</td>
</tr>
<tr>
@ -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,

@ -934,7 +934,6 @@ class PromoteService {
'mobile_phone' => $params['mobile_phone'],
'bank_name' => $params['bank_name'] ?? '',
'bank_card' => $params['bank_card'],
// 'status' => 1,
'parent_id' => $parent ? $parent['id'] : 0,
'parent_name' => $parent ? $parent['account'] : '官方渠道',
'admin_id' => $params['admin_id'] ?? 0,

Loading…
Cancel
Save