酒吧房:->相关接口提交-盲盒转盘-送礼接口修改
This commit is contained in:
@@ -689,7 +689,7 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
|
||||
$this->batchInsertGiftBagReceiveLog($bag_data,$user_id, $boxTurntableLog,$room_id, $precomputedResults);
|
||||
|
||||
// 5. 发送礼物
|
||||
$result = $this->sendGiftsToRecipients($precomputedResults, $room_id,$user_id,$heart_id,$auction_id);
|
||||
$result = $this->sendGiftsToRecipients($bag_data,$precomputedResults, $room_id,$user_id,$heart_id,$auction_id);
|
||||
if (isset($result['code']) && $result['code'] !== 1) {
|
||||
throw new \Exception($result['msg']);
|
||||
}
|
||||
@@ -815,7 +815,7 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
|
||||
/**
|
||||
* 发送礼物给接收者
|
||||
*/
|
||||
private function sendGiftsToRecipients($precomputedResults, $room_id,$user_id,$heart_id,$auction_id)
|
||||
private function sendGiftsToRecipients($bag_data,$precomputedResults, $room_id,$user_id,$heart_id,$auction_id)
|
||||
{
|
||||
// 统计每个用户每个礼物的数量
|
||||
$giftUserCounts = [];
|
||||
@@ -837,28 +837,7 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
|
||||
if($userGift['count'] > 9){ //防止礼物超发,礼物超10个则不发送
|
||||
continue;
|
||||
}
|
||||
$giveGiftExt = [
|
||||
'gift_id' => $userGift['gift_id'],
|
||||
'count' => $userGift['count'],
|
||||
'gift_price' => $userGift['gift_price'],
|
||||
'all_gift_price' => $userGift['gift_price'] * $userGift['count'],
|
||||
'is_draw_gift' => 1
|
||||
];
|
||||
if(!empty($auction_id)){ //竞拍
|
||||
model('RoomAuction')->room_auction_join($auction_id,$user_id,$userGift['gift_id'],$userGift['count'],2,$giveGiftExt);
|
||||
}else{
|
||||
$res = model('Room')->room_gift(
|
||||
$user_id,
|
||||
$userGift['gift_user_id'],
|
||||
$userGift['gift_id'],
|
||||
$userGift['count'],
|
||||
1,
|
||||
$room_id,
|
||||
0,
|
||||
$heart_id,
|
||||
$giveGiftExt
|
||||
);
|
||||
}
|
||||
$res = model("api/SendGift")->single_send_gift_pan($user_id,$userGift['gift_user_id'],$userGift['gift_id'],$userGift['count'],1,$room_id,$bag_data['gift_bag_id'], $heart_id);
|
||||
if (isset($res) && $res['code'] != 1) {
|
||||
Log::record('发送礼物失败: ' . $res['msg'] . $userGift['gift_user_id'], "info");
|
||||
return ['code' => 0, 'msg' => $res['msg'], 'data' => null];
|
||||
|
||||
Reference in New Issue
Block a user