礼包提示

master
zhanglingsheng 5 years ago
parent 186205e10b
commit 4ab2659ec0

@ -152,7 +152,12 @@ class GameGiftPageController extends Controller{
$user_token = $this->userToken;
$novice = $gift->where(["id" => $gift_id])->field("id,giftbag_name,novice")->find();
if(empty($novice['novice'])){
echo "该礼包已被领完";die();
echo json_encode([
'code' => 0,
'status' => 1,
'msg' => '礼包已被领完'
]);
exit();
}
else{
#将激活码分成数据
@ -172,7 +177,12 @@ class GameGiftPageController extends Controller{
$act['novice_num'] = count($novice_arr);
$gift->where("id=".$gift_id)->save($act);
$ddd['novice'] = $data_record['novice'];
echo "领取成功";
echo json_encode([
'code' => 0,
'status' => 1,
'msg' => '领取成功'
]);
exit();
}
}
@ -187,7 +197,12 @@ class GameGiftPageController extends Controller{
$isReceive = $record->where($map)->find();
if(!empty($isReceive)){
$ddd['novice'] = $isReceive['novice'];
echo "您已经领取过该礼包";die();
echo json_encode([
'code' => 0,
'status' => 1,
'msg' => '您已领取过该礼包'
]);
exit();
}
$user_data = get_user_entity($data['user_id']);
$data_record['game_id'] = $data['game_id'];

@ -72,10 +72,11 @@
if(data == '领取成功')
{
window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}";
}else if(data.code == 200)
}else
{
window.location.href = data.url;
$("#errormsg").html(data);
$("#iosDialog").show();
// window.location.href = "{:U('details',['user_token' => $user_token,'gift_id' => $gift_id,'game_id' => $game_id,'game_name' => $game_name])}";
}
});
})

Loading…
Cancel
Save