定版之后bug修改
This commit is contained in:
@@ -389,16 +389,18 @@ class GiveGift extends Model
|
||||
if($gift_box){
|
||||
// 统计相同礼物的数量
|
||||
$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']])) {
|
||||
$giftCount[$gv['gift_id']]['count']++;
|
||||
} else {
|
||||
$giftCount[$gv['gift_id']] = [
|
||||
'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(),
|
||||
'gift_info' => $gift_info,
|
||||
'count' => 1
|
||||
];
|
||||
}
|
||||
$gift_box[$key]['gift_name'] = $gift_info['gift_name'];
|
||||
}
|
||||
|
||||
// 构建文字消息内容
|
||||
@@ -411,14 +413,10 @@ class GiveGift extends Model
|
||||
|
||||
// 推送文字消息 (格式: 张三 送给 李四 趣味礼物 礼物名1 X2,礼物2 X4)
|
||||
$textMessage = $FromUserInfo['nickname'] . ' 送给 ' . $ToUserInfo['nickname'].' 趣味礼物 ' . implode(',', $giftTextList);
|
||||
foreach ($gift_box as $gv) {
|
||||
|
||||
}
|
||||
$box_gift_info =
|
||||
$textData = [
|
||||
'FromUserInfo' => $FromUserInfo,
|
||||
'ToUserInfo' => $ToUserInfo,
|
||||
'GiftInfo' => $gift_box,
|
||||
'GiftInfos' => array_values($gift_box),
|
||||
'GiftNum' => $num,
|
||||
'text' => $textMessage
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user