Commit 87a7d54b authored by 蒋政义's avatar 蒋政义

重复参赛bug

parent bbdcf32d
......@@ -629,11 +629,11 @@ class PkTopAction extends IdentityAction{
D('Sms')->send(['mobile'=>$mobile,'content' =>$bmContent,'type'=>46],true,true);
#富币任务-全民邀请参赛
D('CofCoin')->addMoneyForQmJoin($userId,cookie('aid'));
$result = D('CofCoin')->addMoneyForQmJoin($userId,cookie('aid'));
if(cookie('aid')){
cookie('aid',null);
}
return ['status'=>1,'info'=>'参赛成功','debug'=>$userId];
return ['status' => 1, 'info' => '参赛成功', 'debug' => $userId, 'is_coin' => $result];
}
......
......@@ -35,6 +35,10 @@ class CofCoinModel extends Model
return false;
}
$share_user_info = $share_user_info['data'];
$is_exists = M('CoinDetail')->field('id')->where(['user_id' => $share_user_info['user_id'], 'tid' => $user_id, 'type_id' => self::TYPE_INVITA_QM])->find();
if ($is_exists) {
return false;
}
$my_coin = M('CoinUser')->where(['user_id' => $share_user_info['user_id']])->getField('coin');
if ($my_coin === null) {
M('CoinUser')->add(['user_id' => $share_user_info['user_id'], 'coin' => 0, 'add_time' => time()]);
......@@ -70,6 +74,10 @@ class CofCoinModel extends Model
if(empty($type_info)){
return false;
}
$is_exists = M('CoinDetail')->field('id')->where(['user_id' => $user_id, 'type_id' => self::TYPE_QM_ENTRY])->find();
if ($is_exists) {
return false;
}
#参赛人信息
$user_info = uc_get_user(['userId' => $user_id,'type'=>3]);
if($user_info['data']['user_id'] !== $user_id){
......
......@@ -112,7 +112,15 @@
}
else{
// animPop('#baomingPOP');
animPop('#popPkTopSucc');
if (data.is_coin == 1) {
animPop('#popPkTopSucc');
}else{
layer.open({content: data.info,skin: 'msg',time: 2,
end:function () {
window.location.reload();
}});
}
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment