礼包提示

master
zhanglingsheng 5 years ago
parent 4157fb10b7
commit 9c690a3dbc

@ -143,7 +143,7 @@ class GameGiftPageController extends Controller{
public function receive_gift($user_token = 0,$gift_id = 0,$game_id = 0,$game_name = ""){ public function receive_gift($user_token = 0,$gift_id = 0,$game_id = 0,$game_name = ""){
#获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组 #获取SDK上POST方式传过来的数据 然后base64解密 然后将json字符串转化成数组
$post = I('post.'); $post = I('request.');
$user_id = $this->userId; $user_id = $this->userId;
$gift_id = $post['gift_id']; $gift_id = $post['gift_id'];
$game_id = $post['game_id']; $game_id = $post['game_id'];
@ -178,7 +178,7 @@ class GameGiftPageController extends Controller{
$gift->where("id=".$gift_id)->save($act); $gift->where("id=".$gift_id)->save($act);
$ddd['novice'] = $data_record['novice']; $ddd['novice'] = $data_record['novice'];
echo json_encode([ echo json_encode([
'code' => 0, 'code' => 1,
'status' => 1, 'status' => 1,
'msg' => '领取成功' 'msg' => '领取成功'
]); ]);

@ -76,11 +76,10 @@
success: function (r) { success: function (r) {
if (r.code == 200) { if (r.code == 200) {
window.location.href = r.url; window.location.href = r.url;
} else { } else if(r.code == 1){
if (r == "领取成功") {
window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}"; window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}";
} }else {
// alert(r.msg); alert(r.msg);
} }
} }

Loading…
Cancel
Save