|
|
@ -130,15 +130,15 @@ class SsgController extends BaseController {
|
|
|
|
$_SESSION['user_id'] = $user_id;
|
|
|
|
$_SESSION['user_id'] = $user_id;
|
|
|
|
|
|
|
|
|
|
|
|
$user = M('user', 'tab_')->where(array(
|
|
|
|
$user = M('user', 'tab_')->where(array(
|
|
|
|
'id' => $user_id
|
|
|
|
'id' => $user_id
|
|
|
|
))->find();
|
|
|
|
))->find();
|
|
|
|
if (!$user['promote_id'] && $promote) {
|
|
|
|
if (!$user['promote_id'] && $promote) {
|
|
|
|
M('user', 'tab_')->where(array(
|
|
|
|
M('user', 'tab_')->where(array(
|
|
|
|
'id' => $user_id
|
|
|
|
'id' => $user_id
|
|
|
|
))->save(array(
|
|
|
|
))->save(array(
|
|
|
|
'promote_id' => $promoteId,
|
|
|
|
'promote_id' => $promoteId,
|
|
|
|
'promote_account' => $promote['account']
|
|
|
|
'promote_account' => $promote['account']
|
|
|
|
));
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->ajaxReturn(array("ErrorCode"=>$res_code,"ResultMsg"=>$res_msg),'JSON');
|
|
|
|
$this->ajaxReturn(array("ErrorCode"=>$res_code,"ResultMsg"=>$res_msg),'JSON');
|
|
|
@ -182,15 +182,15 @@ class SsgController extends BaseController {
|
|
|
|
#验证短信验证码
|
|
|
|
#验证短信验证码
|
|
|
|
$this -> sms_verify($user['account'], $user['code']);
|
|
|
|
$this -> sms_verify($user['account'], $user['code']);
|
|
|
|
|
|
|
|
|
|
|
|
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id);
|
|
|
|
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id);
|
|
|
|
if(empty($res)){
|
|
|
|
if(empty($res)){
|
|
|
|
$this -> set_message(1017, "fail", "添加失败");
|
|
|
|
$this -> set_message(1017, "fail", "添加失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//添加自动登录
|
|
|
|
//添加自动登录
|
|
|
|
$userApi = new MemberApi();
|
|
|
|
$userApi = new MemberApi();
|
|
|
|
$user_id = $userApi->login($user['account'], $user['password'],1);
|
|
|
|
$user_id = $userApi->login($user['account'], $user['password'],1);
|
|
|
|
|
|
|
|
|
|
|
|
$this -> set_message(1, "success", "添加成功");
|
|
|
|
$this -> set_message(1, "success", "添加成功");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//忘记密码
|
|
|
|
//忘记密码
|
|
|
@ -229,18 +229,18 @@ class SsgController extends BaseController {
|
|
|
|
$res = $this -> doRegister($account,$password,'',$promoteId,4,1);
|
|
|
|
$res = $this -> doRegister($account,$password,'',$promoteId,4,1);
|
|
|
|
if(empty($res)){
|
|
|
|
if(empty($res)){
|
|
|
|
$this -> set_message(1017, "fail", "添加失败");
|
|
|
|
$this -> set_message(1017, "fail", "添加失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加自动登录
|
|
|
|
//添加自动登录
|
|
|
|
$userApi = new MemberApi();
|
|
|
|
$userApi = new MemberApi();
|
|
|
|
$user_id = $userApi->login($account, $password,1);
|
|
|
|
$user_id = $userApi->login($account, $password,1);
|
|
|
|
|
|
|
|
|
|
|
|
$this -> set_message(1, "success", "添加成功");
|
|
|
|
$this -> set_message(1, "success", "添加成功");
|
|
|
|
# code...
|
|
|
|
# code...
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//消息返回
|
|
|
|
//消息返回
|
|
|
|
public function set_message($status=0,$return_code="fail",$return_msg="操作失败"){
|
|
|
|
public function set_message($status=0,$return_code="fail",$return_msg="操作失败"){
|
|
|
|
$msg = array(
|
|
|
|
$msg = array(
|
|
|
|
"status" => $status,
|
|
|
|
"status" => $status,
|
|
|
|
"return_code" => $return_code,
|
|
|
|
"return_code" => $return_code,
|
|
|
@ -482,15 +482,14 @@ class SsgController extends BaseController {
|
|
|
|
))->find();
|
|
|
|
))->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$payLog = M('game_supersign', 'tab_')->where(array(
|
|
|
|
$isPay = M('game_supersign', 'tab_')->where(array(
|
|
|
|
'user_id' => $userId,
|
|
|
|
'user_id' => $userId,
|
|
|
|
'game_id' => $gameId
|
|
|
|
'game_id' => $gameId,
|
|
|
|
|
|
|
|
'pay_status' =>1
|
|
|
|
))->find();
|
|
|
|
))->find();
|
|
|
|
|
|
|
|
|
|
|
|
if($payLog && $payLog['pay_status']==1){
|
|
|
|
if($isPay){
|
|
|
|
//$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
|
|
|
|
redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$isPay['order_id']);
|
|
|
|
//$this->display('blank');
|
|
|
|
|
|
|
|
redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$payLog['order_id']);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
if (!$gameInfo['supersign_token']) {
|
|
|
|
if (!$gameInfo['supersign_token']) {
|
|
|
|
//$this->error("超级签token未填写!");
|
|
|
|
//$this->error("超级签token未填写!");
|
|
|
@ -527,27 +526,19 @@ class SsgController extends BaseController {
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$payLog = M('game_supersign', 'tab_')->where(array(
|
|
|
|
$isPay = M('game_supersign', 'tab_')->where(array(
|
|
|
|
'user_id' => $userId,
|
|
|
|
'user_id' => $userId,
|
|
|
|
'game_id' => $gameId
|
|
|
|
'game_id' => $gameId,
|
|
|
|
))->find();
|
|
|
|
'pay_status' => 1
|
|
|
|
|
|
|
|
))->find(); //是否有已支付订单
|
|
|
|
|
|
|
|
|
|
|
|
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
|
|
|
|
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
|
|
|
|
'id' => $gameId,
|
|
|
|
'id' => $gameId,
|
|
|
|
))->find();
|
|
|
|
))->find();
|
|
|
|
|
|
|
|
|
|
|
|
if ($payLog && $payLog['pay_status']==0) {
|
|
|
|
if ($isPay){
|
|
|
|
$orderId = $payLog['order_id'];
|
|
|
|
|
|
|
|
}elseif ($payLog && $payLog['pay_status']==1){
|
|
|
|
|
|
|
|
/*$orderId = $payLog['order_id'];
|
|
|
|
|
|
|
|
if(stripos($_SERVER['HTTP_HOST'], '.wmtxkj.cn') || $_SERVER['HTTP_HOST']=='127.0.0.1' || stripos($_SERVER['HTTP_HOST'], '.free.idcfengye.com')){
|
|
|
|
|
|
|
|
redirect("http://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
redirect("https://".$_SERVER['HTTP_HOST']."/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/$orderId");
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
|
|
|
|
$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
|
|
|
|
$this->display('blank');
|
|
|
|
$this->display('blank');
|
|
|
|
//$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
|
|
|
|
|
|
|
|
exit();
|
|
|
|
exit();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
|
|
|
|
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签
|
|
|
|