|
|
|
@ -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'];
|
|
|
|
|