作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

1

... ... @@ -176,14 +176,12 @@ class PrizeController extends WeChatBaseController
}
}
//兑换奖品
public function getPrize(){
$re=$this->checkUser();
$id=$this->request->param('id');
$data['prize_id']=$id;
$data['users_id']=session('wechat_user')['users_id'];
$data['users_id']=$re['id'];
$data['create_time']=time();
Db::name('prize_order')->insert($data);
return 1;
... ...
... ... @@ -428,6 +428,25 @@
}
})
})
$(".changenow").click(function(){
$.ajax({
url: "{:url('portal/prize/getPrize')}",
type: "post",
data: {
id:"{$list.id}",
},
success: function (data) {
if (data==1){
alert('兑换成功')
window.location.reload();
}
else{
alert('兑换失败')
}
}
})
})
</script>
</body>
</html>
... ...