盲盒转盘落包,加推送。
This commit is contained in:
@@ -1554,12 +1554,14 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
|
||||
if (isset($send_result['code']) && $send_result['code'] !== 1) {
|
||||
throw new \Exception($send_result['msg']);
|
||||
}
|
||||
|
||||
$gift_counts = $send_result['data'];
|
||||
|
||||
// 插入抽奖结果
|
||||
$this->batchInsertBlindBoxResults($precomputed_results, $log_id);
|
||||
|
||||
//中大奖礼物飘屏
|
||||
$this->pushGiftBanner($bag_data,$user_id,$gift_counts,$room_id);
|
||||
|
||||
Db::commit();
|
||||
|
||||
// 返回结果
|
||||
@@ -1776,4 +1778,36 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
|
||||
}
|
||||
return ['code' => 1, 'msg' => '发送礼物成功', 'data' => $giftCounts];
|
||||
}
|
||||
|
||||
/**
|
||||
* 岁月之城,时空之旅抽奖-处理中奖通知 推送礼物横幅
|
||||
*/
|
||||
private function pushGiftBanner($bag_data,$user_id,$gift_counts,$room_id)
|
||||
{
|
||||
if($gift_counts){
|
||||
$user_nickname = Db::name('user')->where(['id'=>$user_id])->value('nickname');
|
||||
$text_list_new = [];
|
||||
foreach ($gift_counts as $value) {
|
||||
$draw_gift = Db::name('vs_gift')->where(['gid'=>$value['gift_id']])->find();
|
||||
if($draw_gift['is_public_server'] == 1){
|
||||
$text_message = $user_nickname . '在' . $bag_data['gift_bag_name'] . '中获得了礼物' . $draw_gift['gift_name'] . 'X' . $value['count']."\n";
|
||||
$text_list_new[] = [
|
||||
'text' => $text_message,
|
||||
'gift_picture' => $draw_gift['base_image'],
|
||||
'room_id' => $room_id,
|
||||
'fromUserName' => $user_nickname,
|
||||
'toUserName' => '',
|
||||
'giftName' => $draw_gift['gift_name'],
|
||||
'roomId' => $room_id,
|
||||
'number' => $value['count'],
|
||||
];
|
||||
}
|
||||
if(!empty($text_list_new)){
|
||||
//推送礼物横幅
|
||||
$push = new Push($user_id, $room_id);
|
||||
$push->giftBanner($text_list_new);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2034,7 +2034,7 @@ class Room extends Model
|
||||
$user_info['guild_name'] = null;
|
||||
}
|
||||
//用户所属工会
|
||||
$me_guild_id = Db::name('vs_guild_user')->where(['user_id'=>$uid,'delete_time'=>0,'status' => 1])->value('guild_id');
|
||||
$me_guild_id = Db::name('vs_guild_user')->where(['user_id'=>$uid,'delete_time'=>0,'status' => ['<>',3]])->value('guild_id');
|
||||
if($me_guild_id){
|
||||
$user_info['me_guild_id'] = db::name('vs_guild')->where(['id'=>$me_guild_id])->value('guild_special_id');
|
||||
$user_info['me_guild_name'] = db::name('vs_guild')->where(['id'=>$me_guild_id])->value('guild_name');
|
||||
|
||||
Reference in New Issue
Block a user