|
@@ -193,6 +193,7 @@ class Raffle extends Api
|
|
if(cache($info['uid'])){ //限制抽奖点击频率
|
|
if(cache($info['uid'])){ //限制抽奖点击频率
|
|
$this->error('Click too fast');
|
|
$this->error('Click too fast');
|
|
}
|
|
}
|
|
|
|
+ $code = $this->request->post('code','USD');
|
|
$ponits = $this->getUserPoints($info);
|
|
$ponits = $this->getUserPoints($info);
|
|
if($ponits<10){//检测抽奖积分是否足够
|
|
if($ponits<10){//检测抽奖积分是否足够
|
|
$this->error('Insufficient points!');
|
|
$this->error('Insufficient points!');
|
|
@@ -202,7 +203,7 @@ class Raffle extends Api
|
|
$this->error('No lucky draw times!');
|
|
$this->error('No lucky draw times!');
|
|
}
|
|
}
|
|
cache($info['uid'], 1, 3);
|
|
cache($info['uid'], 1, 3);
|
|
- $prize_arr = $this->getPrize($info['r_id'])['prize'];
|
|
|
|
|
|
+ $prize_arr = $this->getPrize($info['r_id'],$code)['prize'];
|
|
// 把奖品id 设置为键名
|
|
// 把奖品id 设置为键名
|
|
$prize_arr = array_combine(array_column($prize_arr, 'id'), $prize_arr);
|
|
$prize_arr = array_combine(array_column($prize_arr, 'id'), $prize_arr);
|
|
$arr=array();
|
|
$arr=array();
|
|
@@ -231,6 +232,9 @@ class Raffle extends Api
|
|
if($re){//向网站传递抽奖数据,并扣除积分
|
|
if($re){//向网站传递抽奖数据,并扣除积分
|
|
$result = $this->addRafflePrize($info,$data);
|
|
$result = $this->addRafflePrize($info,$data);
|
|
if($result['code']==200){
|
|
if($result['code']==200){
|
|
|
|
+ if($result['data']){
|
|
|
|
+ $res['code']=$result['data']['code'];
|
|
|
|
+ }
|
|
Db::commit();
|
|
Db::commit();
|
|
$this->success('success',$res);
|
|
$this->success('success',$res);
|
|
}else{
|
|
}else{
|