爆币
This commit is contained in:
@@ -43,12 +43,6 @@ class Lottery extends Model
|
||||
$FromUserInfo['icon'][1] = model('UserData')->user_charm_icon($send_uid);//魅力图标
|
||||
$FromUserInfo['chat_bubble'] = model('Decorate')->user_decorate_detail($send_uid,9);//聊天气泡
|
||||
|
||||
$nums = $num * count($toarray);
|
||||
$ress = $this->lottery($send_uid,$gift_info['gift_price'],$nums,$room_id,$gift_id,$FromUserInfo,$gift_info);
|
||||
if($ress['code'] == 0){
|
||||
return ['code' => 0, 'msg' => $ress['msg'], 'data' => null];
|
||||
}
|
||||
|
||||
//送礼 开启事务
|
||||
Db::startTrans();
|
||||
//扣除用户金币并记录日志
|
||||
@@ -125,6 +119,14 @@ class Lottery extends Model
|
||||
model('api/Chat')->sendMsg(1005,$room_id,$text);
|
||||
}
|
||||
Db::commit();
|
||||
|
||||
//计算爆币
|
||||
$nums = $num * count($toarray);
|
||||
$ress = $this->lottery($send_uid,$gift_info['gift_price'],$nums,$room_id,$gift_id,$FromUserInfo,$gift_info);
|
||||
if($ress['code'] == 0){
|
||||
return ['code' => 0, 'msg' => $ress['msg'], 'data' => null];
|
||||
}
|
||||
|
||||
return ['code' => 1, 'msg' => '送礼成功', 'data' => null];
|
||||
}
|
||||
|
||||
|
||||
@@ -245,8 +245,8 @@ if small_total_times >= small_trigger_times then
|
||||
result.big_ratio = big_ratio
|
||||
|
||||
-- 大奖金额计算(基于开奖前的总金额)
|
||||
result.big_prize_amount = math.floor(result.big_pool_total_before_open * big_ratio / 100 * 100) / 100
|
||||
result.big_release_amount = math.floor((result.big_pool_total_before_open - result.big_prize_amount) * 100) / 100
|
||||
result.big_prize_amount = math.floor(big_threshold * big_ratio / 100)
|
||||
result.big_release_amount = math.floor(big_total_gold - result.big_prize_amount)
|
||||
|
||||
-- 重置大奖池,大轮次+1
|
||||
redis.call('set', big_total_gold_key, 0)
|
||||
|
||||
@@ -152,17 +152,17 @@ class LotteryService
|
||||
2, // 大奖池
|
||||
3, // 划转
|
||||
$result['small_remain_amount'],//小奖剩余金额
|
||||
$result['big_total_gold'] - $result['small_remain_amount'],
|
||||
$result['big_total_gold'],
|
||||
$result['big_pool_total_before_open'] - $result['small_remain_amount'],
|
||||
$result['big_pool_total_before_open'],
|
||||
$giftId,
|
||||
$result['big_round'] - ($result['is_big_prize'] ? 1 : 0),
|
||||
"小奖剩余划转大奖池:{$result['small_remain_amount']}金币"
|
||||
);
|
||||
|
||||
|
||||
//2.开小奖剩余划入大奖后 大奖够开奖
|
||||
//开大奖
|
||||
if ($result['is_big_prize'] == 1) {
|
||||
// 大奖中奖记录
|
||||
//2.1 大奖中奖记录
|
||||
$this->addWinnerRecord(
|
||||
$winnerUid,
|
||||
2, // 大奖
|
||||
|
||||
Reference in New Issue
Block a user