定版之后bug修改

This commit is contained in:
2025-09-19 17:33:23 +08:00
parent 39d8853569
commit 73382d1460

View File

@@ -389,16 +389,18 @@ class GiveGift extends Model
if($gift_box){ if($gift_box){
// 统计相同礼物的数量 // 统计相同礼物的数量
$giftCount = []; $giftCount = [];
foreach ($gift_box as $gv) { foreach ($gift_box as $key=>$gv) {
$gift_info = Db::name('vs_gift')->where(['gid'=>$gv['gift_id']])
->field('gid as gift_id,gift_name,gift_price,file_type,base_image,play_image,gift_type,label,is_public_server')->find();
if (isset($giftCount[$gv['gift_id']])) { if (isset($giftCount[$gv['gift_id']])) {
$giftCount[$gv['gift_id']]['count']++; $giftCount[$gv['gift_id']]['count']++;
} else { } else {
$giftCount[$gv['gift_id']] = [ $giftCount[$gv['gift_id']] = [
'gift_info' => Db::name('vs_gift')->where(['gid'=>$gv['gift_id']]) 'gift_info' => $gift_info,
->field('gid as gift_id,gift_name,gift_price,file_type,base_image,play_image,gift_type,label,is_public_server')->find(),
'count' => 1 'count' => 1
]; ];
} }
$gift_box[$key]['gift_name'] = $gift_info['gift_name'];
} }
// 构建文字消息内容 // 构建文字消息内容
@@ -411,14 +413,10 @@ class GiveGift extends Model
// 推送文字消息 (格式: 张三 送给 李四 趣味礼物 礼物名1 X2礼物2 X4) // 推送文字消息 (格式: 张三 送给 李四 趣味礼物 礼物名1 X2礼物2 X4)
$textMessage = $FromUserInfo['nickname'] . ' 送给 ' . $ToUserInfo['nickname'].' 趣味礼物 ' . implode('', $giftTextList); $textMessage = $FromUserInfo['nickname'] . ' 送给 ' . $ToUserInfo['nickname'].' 趣味礼物 ' . implode('', $giftTextList);
foreach ($gift_box as $gv) {
}
$box_gift_info =
$textData = [ $textData = [
'FromUserInfo' => $FromUserInfo, 'FromUserInfo' => $FromUserInfo,
'ToUserInfo' => $ToUserInfo, 'ToUserInfo' => $ToUserInfo,
'GiftInfo' => $gift_box, 'GiftInfos' => array_values($gift_box),
'GiftNum' => $num, 'GiftNum' => $num,
'text' => $textMessage 'text' => $textMessage
]; ];