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,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,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'])) {
$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']);

@ -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 ='新增渠道信息';

@ -7,24 +7,24 @@
<style>
.select2-container--default .select2-selection--single {
color: #000;
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
resize: none;
border-width: 1px;
border-style: solid;
border-color: #a7b5bc #ced9df #ced9df #a7b5bc;
box-shadow: 0px 3px 3px #F7F8F9 inset;height:35px;
height:28px;border-radius:3px;font-size:12px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height:35px;
line-height:28px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height:26px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
height:26px;line-height:26px;font-size:12px;
}
.select2-results__option[aria-selected] {font-size:12px;}
</style>
<!-- 标题栏 -->
@ -37,7 +37,7 @@
<!-- 高级搜索 -->
<div class="jssearch fl cf search_list">
<div class="input-list search-title-box">
<label>搜索:</label>
<label>搜索:</label>
</div>
<div class="input-list">
@ -139,48 +139,60 @@
<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>
</tr>
</volist>
</empty>
<!-- <tr class="data_summary">
<td>汇总</td>
<td colspan="6">
当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount')))}
今日充值:{$ttotal}
昨日充值:{$ytotal}
累计充值:{$total}(此处只汇总充值成功的订单)
</td>
<td colspan="99" style="color: #a9a9a9;">
今日充值:今日平台所有推广员的累计充值(包括官方渠道)/
昨日充值:昨日平台所有推广员的累计充值(包括官方渠道)
</td>
</tr> -->
<!-- <tr class="data_summary">
<td>汇总</td>
<td colspan="6">
当页充值:{:null_to_0(array_sum(array_column(array_status2value('pay_status','',$list_data),'pay_amount')))}
今日充值:{$ttotal}
昨日充值:{$ytotal}
累计充值:{$total}(此处只汇总充值成功的订单)
</td>
<td colspan="99" style="color: #a9a9a9;">
今日充值:今日平台所有推广员的累计充值(包括官方渠道)/
昨日充值:昨日平台所有推广员的累计充值(包括官方渠道)
</td>
</tr> -->
</tbody>
</table>
</div>
</div>
<div class="page">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>21,'xlsname'=>'游戏充值预下单'),I('get.')))}">导出</a>
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>21,'xlsname'=>'游戏充值预下单'),I('get.')))}">导出</a>
{$_page|default=''}
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Spend/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
<div class="common_settings">
<span class="plus_icon"><span><img src="__IMG__/zwmimages/icon_jia.png"></span></span>
<form class="addShortcutIcon">
<input type="hidden" name="title" value="{$m_title}">
<input type="hidden" name="url" value="Spend/lists">
</form>
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
</div>
</block>
@ -197,7 +209,7 @@
<script src="__STATIC__/layer/layer.js" type="text/javascript"></script>
<script>
<volist name = ":I('get.')" id = "vo">
Think.setValue('{$key}', "{$vo}");
Think.setValue('{$key}', "{$vo}");
</volist>
$(".select_gallery").select2();
</script>
@ -418,8 +430,8 @@
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"
@ -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 = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
$("#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 = "<option value=''>请选择区服</option>";
for (var i in data){
str += "<option value='"+data[i].server_name+"' "+(game_server && data[i].server_name == game_server?'selected':'')+">"+data[i].server_name+"</option>"
}
})
});
$("#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单选默认带搜索功能。

@ -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/>
<input type="text" class="txt" name="real_name" value="{$data['real_name']}">
<if condition="$is_admin eq true ">
<input type="text" class="txt" value="{$data['real_name']}" readonly>
<else />
<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