master
chenxiaojun 5 years ago
parent ce01823c6b
commit acf2ff1310

@ -219,7 +219,6 @@ class UserController extends BaseController
public function bindingPromote($promoteId, $account) public function bindingPromote($promoteId, $account)
{ {
Log::write('cxj_login:' . date('Y-m-d H:i:s') . ' ---- ' . $promoteId.'INFO');
if ($promoteId > 0) { if ($promoteId > 0) {
$wherePromote['id'] = $promoteId; $wherePromote['id'] = $promoteId;
$promoteData = M('Promote', 'tab_')->field('id,account')->where($wherePromote)->find(); $promoteData = M('Promote', 'tab_')->field('id,account')->where($wherePromote)->find();
@ -230,7 +229,6 @@ class UserController extends BaseController
$whereUser['mobile_phone'] = $account; $whereUser['mobile_phone'] = $account;
$userData = M('User', 'tab_')->where($whereUser)->find(); $userData = M('User', 'tab_')->where($whereUser)->find();
Log::write('cxj_login:' . date('Y-m-d H:i:s') . ' ---- userData' . json_encode($userData) .'INFO');
if (!empty($userData)) { if (!empty($userData)) {
if (empty($userData['promote_id'])) { if (empty($userData['promote_id'])) {
$saveData['promote_id'] = $promoteId; $saveData['promote_id'] = $promoteId;
@ -405,7 +403,11 @@ class UserController extends BaseController
$pgInfo = strval(cookie('pgInfo')); $pgInfo = strval(cookie('pgInfo'));
Log::write('register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($_POST) . ' --- ' . $pgInfo, 'INFO'); Log::write('register:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($_POST) . ' --- ' . $pgInfo, 'INFO');
if (isset($_POST['promote_id']) && !empty($_POST['promote_id'])) { 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); Log::write('cxj_register:' . date('Y-m-d H:i:s') . ' ---- post' . json_encode($_POST) .' --- INFO');
$thisPromoteAccount = M('promote', 'tab_')->where(array('id' => $_POST['promote_id']))->getField('account');
$thisPromoteAccount = !empty($thisPromoteAccount) ? $thisPromoteAccount : '自然注册';
$promoteAccount = isset($_POST['promote_account']) ? $_POST['promote_account'] : $thisPromoteAccount;
$pid = $this->suser->register($phone, $password, $phone, $register_way, $register_type, $_POST['promote_id'], $promoteAccount, $sex, $nickname, $head_img);
} else { } else {
$pid = $this->suser->register($phone, $password, $phone, $register_way, $register_type, '', '', $sex, $nickname, $head_img); $pid = $this->suser->register($phone, $password, $phone, $register_way, $register_type, '', '', $sex, $nickname, $head_img);
} }

@ -59,14 +59,7 @@
var tis = this,that = $(tis); var tis = this,that = $(tis);
if (that.hasClass('disabled')) {return false;} if (that.hasClass('disabled')) {return false;}
var mobile = $.trim($('#mobile').val()); var mobile = $.trim($('#mobile').val());
var promoteId = parseInt("{:I('get.pid',0)}"); var data = {'phone':mobile};
var gameId = parseInt("{:I('get.gid',0)}");
var data = {};
if (promoteId > 0 && gameId > 0) {
data = {'phone':mobile,'promote_id':promoteId,'game_id':gameId};
} else {
data = {'phone':mobile};
}
if (mobile) { if (mobile) {
if (/^1[0-9]{10}$/.test(mobile)) { if (/^1[0-9]{10}$/.test(mobile)) {
$.ajax({ $.ajax({

Loading…
Cancel
Save