Merge branch 'dev' of 47.111.118.107:/srv/git/platform into dev

master
tpingzhang 5 years ago
commit 9978371b58

@ -61,7 +61,7 @@ class HomeController extends Controller
if ($content) {
$ticketData = json_decode($content, true);
}
$isExpired = false;
$ticket = '';
if ($ticketData) {
@ -92,7 +92,7 @@ class HomeController extends Controller
]);
}
$ticket = $result['ticket'];
file_put_contents(RUNTIME_PATH . 'Data/wechat_ticket', json_encode(['ticket' => $ticket, 'expired_at' => time() + 3600]));
}
@ -149,7 +149,7 @@ class HomeController extends Controller
}
if ($status == 1) {
$downLink = 'itms-services://?action=download-manifest&url=' . "https://" . $_SERVER["HTTP_HOST"] . M('GameSource', 'tab_')->where(array('game_id' => $gameId))->getField('org_plist_url');
$downLink = 'itms-services://?action=download-manifest&url=' . "https://" . $_SERVER["HTTP_HOST"] . ltrim(M('GameSource', 'tab_')->where(array('game_id' => $gameId))->getField('org_plist_url'), '.');
} else {
$downLink = get_apply_dow_url($gameId, $promoteId);
}
@ -230,7 +230,7 @@ class HomeController extends Controller
$map["game_id"] = $user["game_id"];
$map["user_id"] = $user["user_id"];
$map['sdk_version'] = $user['sdk_version'];
$res = $user_play -> where($map) -> find();
$res = $user_play->where($map)->find();
if (empty($res)) {
$user_entity = get_user_entity($user["user_id"]);
$data["user_id"] = $user["user_id"];
@ -254,7 +254,7 @@ class HomeController extends Controller
$data["sdk_version"] = $user["sdk_version"];
$data['ppuid'] = $user['puid'] == '' ? 0 : $user['puid'];
$data['check_time'] = time();
$user_play -> add($data);
$user_play->add($data);
}
}
}

@ -35,6 +35,10 @@ class PromoteController extends BaseController
//系统首页
public function index($p=1)
{
$this->meta_title = "首页";
$this->display('prepare');
exit(0);
header("Content-type:text/html;charset=utf-8");
$user = D('Promote')->isLogin();
if (empty($user)) {

@ -1731,7 +1731,7 @@ class QueryController extends BaseController
$map['game_id'] = $gameId;
}
if ($serverId != 0) {
$map['serverId'] = $serverId;
$map['server_id'] = $serverId;
}
if ($roleName != '') {
$map['role_name'] = ['like', '%' . $roleName . '%'];

@ -721,211 +721,214 @@ class UserEvent extends BaseEvent {
public function arpu_analysis() {
if (IS_POST && $_POST['time_start'] && $_POST['time_end']) {
$request = $_REQUEST;
$game_id = $request['game_id'];
$promote_id = $request['promote_id'];
$this->assign('promote_arpu',$promote_id);
$start = strtotime($request['time_start']);
$end = strtotime($request['time_end'])+24*60*60-1;
if ($start>$end) {
$start = $end;
$_REQUEST['time_start'] = $request['time_end'];
$_REQUEST['time_end'] = $request['time_start'];
$end = strtotime($request['time_start']);
}
$promote = M('promote', 'tab_')->where(['id' => session('promote_auth.pid')])->find();
$map = [
'_logic' => 'or',
'id' => $promote['id'],
'parent_id' => $promote['id'],
'grand_id' => $promote['id'],
];
$ids = M('promote', 'tab_')->where($map)->getField('id', true);
if (IS_POST && $_POST['time_start'] && $_POST['time_end']) {
$request = $_REQUEST;
$game_id = $request['game_id'];
$promote_id = $request['promote_id'];
$this->assign('promote_arpu', $promote_id);
$start = strtotime($request['time_start']);
$end = strtotime($request['time_end'])+24*60*60-1;
if ($start>$end) {
$start = $end;
$_REQUEST['time_start'] = $request['time_end'];
$_REQUEST['time_end'] = $request['time_start'];
$end = strtotime($request['time_start']);
}
} else {
$game_id = empty($request['game_id'])?0:$request['game_id'];
$promote_id = empty($request['promote_id'])?0:$request['promote_id'];
$start = mktime(0,0,0,date('m'),date('d')-6,date('Y'));
$_REQUEST['time_start'] = date('Y-m-d',$start);
$end = time();
$_REQUEST['time_end'] = date('Y-m-d');
}
} else {
$game_id = empty($request['game_id'])?0:$request['game_id'];
$promote_id = empty($request['promote_id'])?0:$request['promote_id'];
$start = mktime(0,0,0,date('m'),date('d')-6,date('Y'));
$_REQUEST['time_start'] = date('Y-m-d',$start);
$end = time();
$_REQUEST['time_end'] = date('Y-m-d');
}
//包含绑币 和 排除绑币
if (I('bind_coin') == 1){
$bangbi = true;
}else{
$bangbi = false;
}
//包含绑币 和 排除绑币
if (I('bind_coin') == 1){
$bangbi = true;
}else{
$bangbi = false;
}
if ($end-$start<=7776000 ) {
if ($end - $start <= 7776000 ) {
if ($promote_id <1) {
$pid = D('Promote')->get_child_promote(PID,'id');
if (empty($pid[0])) {
$promote_id = PID;
} else {
$id = implode(',',array_column($pid,'id'));
$promote_id = PID.','.$id;
}
$pid = D('Promote')->get_child_promote(PID,'id');
if (empty($pid[0])) {
$promote_id = PID;
} else {
$id = implode(',',array_column($pid,'id'));
$promote_id = PID.','.$id;
}
} else {
if(PID == $promote_id) {
if(PID == $promote_id) {
} else {
$pro_id1=get_prmoote_chlid_account($promote_id);
$pro_arr = array_column($pro_id1,'id');
$pro_arr[] = $promote_id;
$promote_id=implode(',',$pro_arr);
}
}
$datelist = get_date_list($start,$end);
$user = D('User');
$spend = D('Spend');
/*付费游戏数*/
$paygame = $spend->pay_game_by_time($start,$end,$game_id,$promote_id,$bangbi);
$newslist = $user->register_list_by_time($start,$end,$game_id,$promote_id,'time','');
/* 活跃玩家 */
$activelist = $user->login_count_by_time($start,$end,$game_id,$promote_id);
/* 充值金额 */
$incomelist = $spend -> money_amount_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 付费玩家 */
$paylist = $spend->pay_count_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 新付费玩家 */
$newspay = $spend->pay_count_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/*新付费金额*/
$newspaysum = $spend->pay_sum_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/* 开始时间前的付费玩家 */
$totalPayPlayer = $spend->payUsersStatisticsAgo($start,$game_id,$promote_id,$bangbi);
/* 留存 */
$ratention1 = $user->ratention_rate($newslist,$game_id,$promote_id);
/* 数据整理 */
foreach($datelist as $dv) {
$newPayUsers[$dv]=$activeUsers[$dv]=$newUsers[$dv]=$payUsers[$dv]=$usersIncome[$dv]=$ratentionRate1[$dv]=0;
$data[$dv]['newPayUsers']=$data[$dv]['activeUsers']=$data[$dv]['newUsers']=$data[$dv]['payUsers']=$data[$dv]['usersIncome']=0;
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
$data[$dv]['ratentionRate1']='--';
$data[$dv]['usersPayRate'] = '--';
$data[$dv]['usersArpu']=0;
$data[$dv]['usersArppu']=0;
$data[$dv]['payGame'] = 0;
} else {
$pro_id1 = get_prmoote_chlid_account($promote_id);
$pro_arr = array_column($pro_id1,'id');
$pro_arr[] = $promote_id;
$promote_id=implode(',',$pro_arr);
}
}
$datelist = get_date_list($start,$end);
$user = D('User');
$spend = D('Spend');
/*付费游戏数*/
$paygame = $spend->pay_game_by_time($start,$end,$game_id,$promote_id,$bangbi);
$newslist = $user->register_list_by_time($start,$end,$game_id,$promote_id,'time','');
/* 活跃玩家 */
$activelist = $user->login_count_by_time($start,$end,$game_id,$promote_id);
/* 充值金额 */
$incomelist = $spend -> money_amount_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 付费玩家 */
$paylist = $spend->pay_count_by_time($start,$end,$game_id,$promote_id,$bangbi);
/* 新付费玩家 */
$newspay = $spend->pay_count_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/*新付费金额*/
$newspaysum = $spend->pay_sum_by_time_class_game($datelist,$game_id,$promote_id,1,$bangbi);
/* 开始时间前的付费玩家 */
$totalPayPlayer = $spend->payUsersStatisticsAgo($start,$game_id,$promote_id,$bangbi);
/* 留存 */
$ratention1 = $user->ratention_rate($newslist,$game_id,$promote_id);
/* 数据整理 */
foreach($datelist as $dv) {
$newPayUsers[$dv]=$activeUsers[$dv]=$newUsers[$dv]=$payUsers[$dv]=$usersIncome[$dv]=$ratentionRate1[$dv]=0;
$data[$dv]['newPayUsers']=$data[$dv]['activeUsers']=$data[$dv]['newUsers']=$data[$dv]['payUsers']=$data[$dv]['usersIncome']=0;
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
$data[$dv]['ratentionRate1']='--';
$data[$dv]['usersPayRate'] = '--';
$data[$dv]['usersArpu']=0;
$data[$dv]['usersArppu']=0;
$data[$dv]['payGame'] = 0;
}
foreach($datelist as $dv) {
/**
* 付费游戏数
*/
foreach ($paygame as $pgal) {
if($dv == $pgal['pay_time']) {
$paygame[$dv]=intval($pgal['pay_num']);
$data[$dv]['payGame']=intval($pgal['pay_num']);break;
}
}
foreach($datelist as $dv) {
/**
* 付费游戏数
*/
foreach ($paygame as $pgal) {
if($dv == $pgal['pay_time']) {
$paygame[$dv]=intval($pgal['pay_num']);
$data[$dv]['payGame']=intval($pgal['pay_num']);break;
}
}
/* 新增玩家 */
foreach ($newslist as $nlv) {
if ($dv == $nlv['time']) {
/* 新增玩家 */
foreach ($newslist as $nlv) {
if ($dv == $nlv['time']) {
$data[$dv]['newUsers']=count(explode(',',$nlv['id']));break;
}
}
/* 活跃玩家 */
foreach ($activelist as $alv) {
if ($dv == $alv['time']) {
$activeUsers[$dv]=intval($alv['login_num']);
$data[$dv]['newUsers']=count(explode(',',$nlv['id']));break;
}
}
/* 活跃玩家 */
foreach ($activelist as $alv) {
if ($dv == $alv['time']) {
$activeUsers[$dv]=intval($alv['login_num']);
$data[$dv]['activeUsers']=intval($alv['login_num']);break;
}
}
$data[$dv]['activeUsers']=intval($alv['login_num']);break;
}
}
/* 充值金额 */
foreach ($incomelist as $ilv) {
if($ilv['pay_time']==$dv) {
$usersIncome[$dv] = round($ilv['money_amount'],2);
$data[$dv]['usersIncome'] = round($ilv['money_amount'],2);
break;
}
}
/* 付费玩家 */
foreach ($paylist as $plv) {
if ($plv['pay_time']==$dv) {
$payUsers[$dv]=intval($plv['pay_num']);
/* 充值金额 */
foreach ($incomelist as $ilv) {
if($ilv['pay_time']==$dv) {
$usersIncome[$dv] = round($ilv['money_amount'],2);
$data[$dv]['usersIncome'] = round($ilv['money_amount'],2);
break;
}
}
/* 付费玩家 */
foreach ($paylist as $plv) {
if ($plv['pay_time']==$dv) {
$payUsers[$dv]=intval($plv['pay_num']);
$data[$dv]['payUsers']=intval($plv['pay_num']);break;
}
}
/* 1日留存 */
foreach ($ratention1 as $r1) {
if ($r1['play_time'] == $dv) {
$rate = str_replace('.00','',$r1['retention_rate1']);
$data[$dv]['ratentionRate1']=$rate.'%';break;
}
}
/* 新付费玩家 */
foreach ($newspay as $npv) {
if ($npv['pay_time'] == $dv) {
$totalPayPlayer = $totalPayPlayer+intval($npv['pay_num']);
$data[$dv]['payUsers']=intval($plv['pay_num']);break;
}
}
/* 1日留存 */
foreach ($ratention1 as $r1) {
if ($r1['play_time'] == $dv) {
$rate = str_replace('.00','',$r1['retention_rate1']);
$data[$dv]['ratentionRate1']=$rate.'%';break;
}
}
/* 新付费玩家 */
foreach ($newspay as $npv) {
if ($npv['pay_time'] == $dv) {
$totalPayPlayer = $totalPayPlayer+intval($npv['pay_num']);
$data[$dv]['newPayUsers']=intval($npv['pay_num']);
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
break;
} else {
$data[$dv]['newPayUsers']=intval($npv['pay_num']);
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
break;
} else {
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
}
}
/*新付费金额*/
foreach ($newspaysum as $nspv) {
if ($nspv['pay_time'] == $dv) {
$data[$dv]['newPaySum']=round($nspv['pay_sum'],2);
break;
}
}
}
foreach ($activeUsers as $k1=>$ap) {
/* 付费率=付费玩家/活跃玩家 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $ap>0 && $pp>0) {
$payrate = sprintf("%.2f",$pp/$ap*100);
$data[$k1]['usersPayRate']=str_replace('.00','',$payrate).'%';
break;
} elseif ($k1 === $k2) {
}
$data[$dv]['totalPayUsers']=intval($totalPayPlayer);
}
}
/*新付费金额*/
foreach ($newspaysum as $nspv) {
if ($nspv['pay_time'] == $dv) {
$data[$dv]['newPaySum']=round($nspv['pay_sum'],2);
break;
}
}
}
/* ARPU=当日总充值数/活跃玩家数 */
foreach ($usersIncome as $k2 => $ns) {
if ($k1 === $k2 && $ap>0 && $ns>0) {
$data[$k1]['usersArpu']=$ns/$ap;//str_replace('.00','',$ui);
break;
} elseif ($k1 === $k2) {
}
foreach ($activeUsers as $k1=>$ap) {
/* 付费率=付费玩家/活跃玩家 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $ap>0 && $pp>0) {
$payrate = sprintf("%.2f",$pp/$ap*100);
$data[$k1]['usersPayRate']=str_replace('.00','',$payrate).'%';
break;
} elseif ($k1 === $k2) {
}
}
/* ARPU=当日总充值数/活跃玩家数 */
foreach ($usersIncome as $k2 => $ns) {
if ($k1 === $k2 && $ap>0 && $ns>0) {
$data[$k1]['usersArpu']=$ns/$ap;//str_replace('.00','',$ui);
break;
} elseif ($k1 === $k2) {
}
}
}
}
foreach ($usersIncome as $k1 => $ns) {
/* ARPPU=当日总充值/付费玩家数 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $pp>0 && $ns>0) {
$data[$k1]['usersArppu']=$ns/$pp;//sprintf("%d",$ns/$pp);
break;
} elseif ($k1 === $k2) {
}
}
}
} else {
$this->assign('timeout',1);
}
foreach ($usersIncome as $k1 => $ns) {
/* ARPPU=当日总充值/付费玩家数 */
foreach ($payUsers as $k2 => $pp) {
if ($k1 === $k2 && $pp>0 && $ns>0) {
$data[$k1]['usersArppu']=$ns/$pp;//sprintf("%d",$ns/$pp);
break;
} elseif ($k1 === $k2) {
}
}
}
//file_put_contents(dirname(__FILE__) . '/../Controller/arpu'.PID.'.txt',json_encode($data));
} else {
$this->assign('timeout',1);
}
$this->assign('list_data',$data);
//file_put_contents(dirname(__FILE__) . '/../Controller/arpu'.PID.'.txt',json_encode($data));
$this->display();
$this->assign('list_data',$data);
$this->display();
}

@ -209,7 +209,7 @@
}
} else {
if (is_ios()) {
if (!Boolean(navigator.userAgent.match(/OS [1][3]_[1][_\d]* like Mac OS X/i))) {
if (Boolean(navigator.userAgent.match(/OS [1][3]_[1][_\d]* like Mac OS X/i))) {
if (parseInt("{:I('get.status')}") > 0) {
location.href = "{:U('iosDown',array('gid'=>$gameId,'pid'=>I('get.pid'),'status'=>1))}";
return false;

@ -5,16 +5,16 @@
<block name="body">
<div class="page-overview promote-index-overview index-overview clearfix poll">
<ul>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><div class="text text2"><p>推广总用户</p><span>{$user_count}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><div class="text text1"><p>推广总充值</p><span>¥{$total_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><div class="text text3"><p>当日新增用户充值</p><span>¥{$today_add_user_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><div class="text text5"><p>当月新增用户充值</p><span>¥{$month_add_user_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><!-- <div class="text text2"><p>推广总用户</p><span>{$user_count}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><!-- <div class="text text1"><p>推广总充值</p><span>¥{$total_money}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><!-- <div class="text text3"><p>当日新增用户充值</p><span>¥{$today_add_user_money}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><!-- <div class="text text5"><p>当月新增用户充值</p><span>¥{$month_add_user_money}</span></div> --></li>
</ul>
<ul style="margin-top: 10px">
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><div class="text text2"><p>昨日注册用户</p><span>{$yesterday_user_regist_count}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><div class="text text1"><p>昨日充值金额</p><span>¥{$yesterday_total_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><div class="text text3"><p>今日注册用户</p><span>{$yesterday_regist_user_count}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><div class="text text5"><p>今日充值金额</p><span>¥{$yesterday_total_money}</span></div></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi1.png"/></span></div><!-- <div class="text text2"><p>昨日注册用户</p><span>{$yesterday_user_regist_count}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi2.png"/></span></div><!-- <div class="text text1"><p>昨日充值金额</p><span>¥{$yesterday_total_money}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi3.png"/></span></div><!-- <div class="text text3"><p>今日注册用户</p><span>{$yesterday_regist_user_count}</span></div> --></li>
<li><div class="icon"><span class="placeholder-graphic"><img src="__IMG__/20180207/icon_chongzhi5.png"/></span></div><!-- <div class="text text5"><p>今日充值金额</p><span>¥{$yesterday_total_money}</span></div> --></li>
</ul>
</div>
<div class="index-tab-list">

@ -0,0 +1,10 @@
<extend name="Public/promote_base"/>
<block name="css">
<link href="__CSS__/index/index.new.css" rel="stylesheet" >
</block>
<block name="body">
<div class="page-overview promote-index-overview index-overview clearfix poll">
<div>首页优化中,暂未开放!</div>
</div>
</block>

@ -112,15 +112,15 @@
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">推广员账号:</label>
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:170px;">
<option game-id="0" value="0">推广员账号</option>
<option game-id="{:session('promote_auth.pid')}" value="{:session('promote_auth.pid')}">自己</option>
<volist name=":get_promote_chlid_account(PID)" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
<input type="hidden" id="promote_account" name="promote_account" value='{:I("promote_account")}'>
<label class="form-title select-title">推广员账号:</label>
<select id="promote_id" name="promote_id" class="reselect select_gallery" style="min-width:170px;">
<option game-id="0" value="0">推广员账号</option>
<option game-id="{:session('promote_auth.pid')}" value="{:session('promote_auth.pid')}">自己</option>
<volist name=":get_promote_chlid_account(PID)" id="vo">
<option game-id="{$vo.id}" value="{$vo.id}">{$vo.account}</option>
</volist>
</select>
<input type="hidden" id="promote_account" name="promote_account" value='{:I("promote_account")}'>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">游戏名称:</label>

@ -28,7 +28,7 @@
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['id']">selected</if>>{$game.game_name}</option>
<option value="{$game.game_id}" <if condition="I('game_id') === $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
@ -47,22 +47,22 @@
<option value="2" <if condition="I('sdk_version') === '2'">selected</if>>IOS</option>
</select>
</div>
<if condition="$grand_id eq 0">
<if condition="$parent_id eq 0">
<div class="form-group normal_space">
<select id="group-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
<select id="group-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('headman_promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
</if>
<if condition="$parent_id eq 0">
<if condition="$grand_id eq 0">
<div class="form-group normal_space">
<select id="promote-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}">{$promote.account}</option>
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>

@ -28,7 +28,7 @@
<select id="game-select" name="game_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择游戏</option>
<volist name="games" id="game">
<option value="{$game.game_id}" <if condition="I('game_id') === $game['id']">selected</if>>{$game.game_name}</option>
<option value="{$game.game_id}" <if condition="I('game_id') eq $game['game_id']">selected</if>>{$game.game_name}</option>
</volist>
</select>
</div>
@ -58,7 +58,7 @@
<select id="group-select" name="headman_promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择组长</option>
<volist name="groupPromotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') === $promote['id']">selected</if>>{$promote.account}</option>
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('headman_promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>
@ -68,7 +68,7 @@
<select id="promote-select" name="promote_id" class="reselect select_gallery" style="width: 220px;" >
<option value="0">请选择推广员</option>
<volist name="promotes" id="promote">
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') === $promote['id']">selected</if>>{$promote.account}</option>
<option ba-id="{$promote.id}" value="{$promote.id}" <if condition="I('promote_id') == $promote['id']">selected</if>>{$promote.account}</option>
</volist>
</select>
</div>

@ -5,6 +5,7 @@ use User\Api\SuserApi;
use Org\UcenterSDK\Ucservice;
use User\Api\MemberApi;
use Admin\Model\PointTypeModel;
use Think\Log;
class UserController extends BaseController {
private $suser;
@ -31,7 +32,7 @@ class UserController extends BaseController {
$member = new MemberApi();
/*是否开启Ucenter*/
if( C('UC_OPEN')==1 ){
if( C('UC_OPEN')==1 ) {
$username = $account;
//Ucenter登录
@ -170,20 +171,32 @@ class UserController extends BaseController {
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
'msg' => '绑定失败',
);
}
} else {
if ($userData['promote_id'] == $promoteId) {
$data = array(
'status' => 2,
'msg' => '登录成功!绑定成功',
);
} else {
$data = array(
'status' => 0,
'msg' => '号码已绑定其他推广员',
);
}
}
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
'msg' => '数据异常',
);
}
} else {
$data = array(
'status' => 0,
'msg' => '登录成功!绑定失败',
'msg' => '数据异常',
);
}
} else {
@ -206,6 +219,12 @@ class UserController extends BaseController {
}
echo json_encode($data);die();
} else {
$pid = I('get.pid', 0);
$gid = I('get.gid', 0);
if ($pid > 0 || $gid > 0) {
cookie('pgInfo', json_encode(['pid' => $pid, 'gid' => $gid]), 3600 * 24);
}
if($_REQUEST['url']){
$this->assign('url',base64_decode(base64_decode($_REQUEST['url'])));
}else{
@ -307,8 +326,6 @@ class UserController extends BaseController {
}
$register_way = 4;
$register_type = 2;
switch ($sex) {
@ -320,7 +337,17 @@ class UserController extends BaseController {
break;
}
if (!preg_match("/^1[34578]\d{9}$/", $phone)) {
echo json_encode(['status' => 0,'msg' => '手机号格式不正确']);
die;
}
if (!preg_match("/^[a-zA-Z0-9]{6,15}+$/", $password)) {
echo json_encode(['status' => 0,'msg' => '密码格式不正确']);
die;
}
$pgInfo = strval(cookie('pgInfo'));
Log::write('register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($_POST) . ' --- ' . $pgInfo, 'INFO');
if (isset($_POST['promote_id']) && !empty($_POST['promote_id'])) {
$pid = $this->suser->register($phone,$password,$phone,$register_way,$register_type,$_POST['promote_id'],$_POST['promote_account'],$sex,$nickname,$head_img);
} else {
@ -349,6 +376,12 @@ class UserController extends BaseController {
}
echo json_encode($data);
} else{
$pid = I('get.pid', 0);
$gid = I('get.gid', 0);
if ($pid > 0 || $gid > 0) {
cookie('pgInfo', json_encode(['pid' => $pid, 'gid' => $gid]), 3600 * 24);
}
if ($_REQUEST['url']) {
$url= base64_decode($_REQUEST['url']);
} else {
@ -375,6 +408,9 @@ class UserController extends BaseController {
$password = $post['password'];
$sex = $post['sex'];
$pgInfo = strval(cookie('pgInfo'));
Log::write('step1:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($post) . ' --- ' . $pgInfo, 'INFO');
/**是否开启ucenter**/
if(C('UC_OPEN')==1){
@ -430,6 +466,16 @@ class UserController extends BaseController {
echo json_encode(array('status'=>0,'msg'=>'账号已存在'));exit;
}
if (!preg_match("/^[a-z\d]{6,15}$/i", $account)) {
echo json_encode(['status' => 0,'msg' => '账号格式不正确']);
die;
}
if (!preg_match("/^[a-zA-Z0-9]{6,15}+$/", $password)) {
echo json_encode(['status' => 0,'msg' => '密码格式不正确']);
die;
}
$pid = $this->suser->register($account,$password,'',$register_way,$register_type,'','',$sex,$nickname,$head_img);
if($pid > 0){

@ -28,11 +28,15 @@
<body class="unlr">
<header class="header login-header">
<div class="">
<if condition="I('get.back') neq ''">
<a href="javascript:;history.go('{:I('get.back')}')" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('user')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<if condition="I('get.pid') gt 0">
<a href="javascript:;history.back(-1)" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<if condition="I('get.back') neq ''">
<a href="javascript:;history.go('{:I('get.back')}')" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('user')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
</if>
<h1 class="caption">用户登录</h1>
</div>
</header>

@ -20,7 +20,11 @@
<body class="unlr">
<header class="header forget-header">
<div class="">
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<if condition="I('get.pid') gt 0">
<a href="{:U('login',array('pid'=>I('get.pid'),'gid'=>I('get.gid')))}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<h1 class="caption">注册</h1>
</div>
</header>

@ -20,7 +20,11 @@
<body class="unlr">
<header class="header forget-header">
<div class="">
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<if condition="I('get.pid') gt 0">
<a href="{:U('login',array('pid'=>I('get.pid'),'gid'=>I('get.gid')))}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<h1 class="caption">注册</h1>
</div>
</header>

@ -20,7 +20,11 @@
<body class="unlr">
<header class="header forget-header">
<div class="">
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<if condition="I('get.pid') gt 0">
<a href="{:U('login',array('pid'=>I('get.pid'),'gid'=>I('get.gid')))}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
<else/>
<a href="{:U('login')}" class="hbtn back"><i class="iconfont icon-drop-left"></i></a>
</if>
<h1 class="caption">账号注册</h1>
</div>
</header>

@ -670,10 +670,9 @@ class UserController extends BaseController
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
#判断数据是否为空
if (empty($user)) {
$this -> set_message(1001, "fail", "注册数据不能为空");
}
Log::write('user_register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($user), 'INFO');
/**是否开启ucenter**/
if (C('UC_OPEN') == 1) {
//Ucenter注册
@ -720,10 +719,10 @@ class UserController extends BaseController
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
if (empty($user)) {
$this -> set_message(1001, "fail", "注册数据不能为空");
}
Log::write('user_email_register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($user), 'INFO');
$v_res = $this -> verify_email_code($user['account'], $user['code']);
if ($v_res) {
@ -745,10 +744,9 @@ class UserController extends BaseController
$user = json_decode(base64_decode(file_get_contents("php://input")), true);
#判断数据是否为空
if (empty($user)) {
$this -> set_message(1001, "fail", "注册数据不能为空");
}
Log::write('user_phone_register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($user), 'INFO');
#验证短信验证码
$this -> sms_verify($user['account'], $user['code']);
/**是否开启ucenter**/

Loading…
Cancel
Save