超级签购买测试

master
zhengchanglong 5 years ago
parent 65fd27fe36
commit 628b90b72c

@ -130,15 +130,15 @@ class SsgController extends BaseController {
$_SESSION['user_id'] = $user_id;
$user = M('user', 'tab_')->where(array(
'id' => $user_id
'id' => $user_id
))->find();
if (!$user['promote_id'] && $promote) {
M('user', 'tab_')->where(array(
'id' => $user_id
))->save(array(
'promote_id' => $promoteId,
'promote_account' => $promote['account']
));
M('user', 'tab_')->where(array(
'id' => $user_id
))->save(array(
'promote_id' => $promoteId,
'promote_account' => $promote['account']
));
}
}
$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']);
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id);
if(empty($res)){
$res = $this -> doRegister($user['account'],$user['password'],$user['account'],$promoteId,4,2, $game_id);
if(empty($res)){
$this -> set_message(1017, "fail", "添加失败");
}
//添加自动登录
$userApi = new MemberApi();
$user_id = $userApi->login($user['account'], $user['password'],1);
}
//添加自动登录
$userApi = new MemberApi();
$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);
if(empty($res)){
$this -> set_message(1017, "fail", "添加失败");
}
}
//添加自动登录
$userApi = new MemberApi();
$user_id = $userApi->login($account, $password,1);
//添加自动登录
$userApi = new MemberApi();
$user_id = $userApi->login($account, $password,1);
$this -> set_message(1, "success", "添加成功");
$this -> set_message(1, "success", "添加成功");
# 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(
"status" => $status,
"return_code" => $return_code,
@ -482,15 +482,14 @@ class SsgController extends BaseController {
))->find();
$payLog = M('game_supersign', 'tab_')->where(array(
$isPay = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
'game_id' => $gameId,
'pay_status' =>1
))->find();
if($payLog && $payLog['pay_status']==1){
//$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
//$this->display('blank');
redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$payLog['order_id']);
if($isPay){
redirect("/mobile.php/Ssg/install_show/user_id/$userId/game_id/$gameId/order_id/".$isPay['order_id']);
}else{
if (!$gameInfo['supersign_token']) {
//$this->error("超级签token未填写");
@ -527,27 +526,19 @@ class SsgController extends BaseController {
exit();
}
$payLog = M('game_supersign', 'tab_')->where(array(
$isPay = M('game_supersign', 'tab_')->where(array(
'user_id' => $userId,
'game_id' => $gameId
))->find();
'game_id' => $gameId,
'pay_status' => 1
))->find(); //是否有已支付订单
$gameInfo = M('game', 'tab_')->field('game_name,supersign_token')->where(array(
'id' => $gameId,
))->find();
if ($payLog && $payLog['pay_status']==0) {
$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");
}*/
if ($isPay){
$this->assign("error","亲~您已购买过了~<br/>请到【订单查询】查看订单信息哟~");
$this->display('blank');
//$this->error("亲~您已购买过了~请到【订单查询】查看订单信息哟~");
exit();
} else {
$orderId = "SS_" . date('Ymd') . date('His') . sp_random_string(4); // 超级签

Loading…
Cancel
Save