|
|
|
@ -25,6 +25,7 @@ class SsgController extends BaseController {
|
|
|
|
|
public function login()
|
|
|
|
|
{
|
|
|
|
|
$promoteId = I("promote_id", 0);
|
|
|
|
|
$gameId = I("game_id", 0);
|
|
|
|
|
$user = session("user_auth");
|
|
|
|
|
if ($user) {
|
|
|
|
|
redirect(U("ssg/index", array('promete_id' => $promoteId)));
|
|
|
|
@ -44,6 +45,7 @@ class SsgController extends BaseController {
|
|
|
|
|
$this->assign("app_qq", $appqq);
|
|
|
|
|
|
|
|
|
|
$this->assign("promote_id", $promoteId);
|
|
|
|
|
$this->assign("game_id", $gameId);
|
|
|
|
|
$this->display();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -163,6 +165,7 @@ class SsgController extends BaseController {
|
|
|
|
|
|
|
|
|
|
$user = $_POST;
|
|
|
|
|
$promoteId =( $user['promote_id'] ? $user['promote_id'] : 0);
|
|
|
|
|
$game_id = $user['game_id'] ?? 0;
|
|
|
|
|
#判断数据是否为空
|
|
|
|
|
if (empty($user)) {
|
|
|
|
|
$this -> set_message(1001, "fail", "注册数据不能为空");
|
|
|
|
@ -170,7 +173,7 @@ class SsgController extends BaseController {
|
|
|
|
|
#验证短信验证码
|
|
|
|
|
$this -> sms_verify($user['account'], $user['code']);
|
|
|
|
|
|
|
|
|
|
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2);
|
|
|
|
|
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id);
|
|
|
|
|
if(empty($res)){
|
|
|
|
|
$this -> set_message(1017, "fail", "添加失败");
|
|
|
|
|
}
|
|
|
|
@ -238,7 +241,7 @@ class SsgController extends BaseController {
|
|
|
|
|
exit();
|
|
|
|
|
}
|
|
|
|
|
//真正注册代码
|
|
|
|
|
public function doRegister($account,$password,$phone,$promote_id,$register_way,$register_type)
|
|
|
|
|
public function doRegister($account,$password,$phone,$promote_id,$register_way,$register_type, $game_id = 0)
|
|
|
|
|
{
|
|
|
|
|
//验证账号
|
|
|
|
|
$is_user_info = M('user', 'tab_') -> where(['account' => $account]) -> find();
|
|
|
|
@ -271,6 +274,13 @@ class SsgController extends BaseController {
|
|
|
|
|
'check_time' => time(),
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
if ($game_id) {//关联游戏
|
|
|
|
|
$game = M('game', 'tab_')->where(['id' => $game_id])->find();
|
|
|
|
|
if ($game) {
|
|
|
|
|
$data['fgame_id'] = $game_id;
|
|
|
|
|
$data['fgame_name'] = $game['game_name'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* 添加用户 */
|
|
|
|
|
$res = M('user', 'tab_') ->add($data);
|
|
|
|
|
return $res;
|
|
|
|
@ -449,9 +459,11 @@ class SsgController extends BaseController {
|
|
|
|
|
public function pay(){
|
|
|
|
|
$user = session("user_auth");
|
|
|
|
|
$gameId = I("game_id", 0);
|
|
|
|
|
$promoteId = I("promote_id");
|
|
|
|
|
|
|
|
|
|
//$price = self::signprice;
|
|
|
|
|
if (!$user) {
|
|
|
|
|
redirect("/mobile.php/ssg/login");
|
|
|
|
|
redirect("/mobile.php/ssg/login/game_id/{$gameId}/promote_id/$promoteId");
|
|
|
|
|
// $this->error("请登入", "/mobile.php/ssg/login");
|
|
|
|
|
}
|
|
|
|
|
$userId = $user['user_id'];
|
|
|
|
@ -485,8 +497,6 @@ class SsgController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 发起支付
|
|
|
|
|
*/
|
|
|
|
|