Cp礼物送礼处理

This commit is contained in:
2025-11-19 10:16:35 +08:00
parent dc239087d5
commit 7490acac12

View File

@@ -135,6 +135,8 @@ class GiveGift extends Model
$give_gift = 0; $give_gift = 0;
$gift_user_data = []; $gift_user_data = [];
$cp_type = 0; $cp_type = 0;
$text = '';
$text1 = '';
foreach ($toarray as $k => $to_id){ foreach ($toarray as $k => $to_id){
$gift_user_data[]['user_id'] = $to_id; $gift_user_data[]['user_id'] = $to_id;
$gift_box1 = []; $gift_box1 = [];
@@ -520,7 +522,15 @@ class GiveGift extends Model
model('DailyTasks')->tasks_complete($uid,3); model('DailyTasks')->tasks_complete($uid,3);
} }
//cp检测且处理升级事宜 //cp检测且处理升级事宜
$cp_type = model('api/UserCp')->checkGift($uid, $give_gift, $to_id, $from_id);//0-不处理1-表明心意2-组成Cp $cp_type = model('api/UserCp')->checkGift($uid, $gid, $to_id, $from_id);//0-不处理1-表明心意2-组成Cp
if($cp_type == 1){
$text1 = "亲爱的用户,您好!\n".$FromUserInfo['nickname'] . ' 的 【' .$gift_info['gift_name'].' 】 已送达,这是他的心动信号。回赠一个,即可锁定这份缘分!';
$text = '';
}elseif ($cp_type == 2){
//接受方弹起的 信息
$text1 = "恭喜你!". $FromUserInfo['nickname'] ."也向您回赠了【" .$gift_info['gift_name']."】,并接受了你的心动信号。\n从现在起你们正式成为彼此的专属CP共同开启一段甜蜜的旅程。\n【心动空间】已为你们敞开大门这里将记录你们在一起的点滴见证所有心动与陪伴。快去心动空间开启你们的CP升级之旅吧";
$text = '【心动空间】已为你们敞开大门这里将记录你们在一起的点滴见证所有心动与陪伴。快去心动空间开启你们的CP升级之旅吧';//发送方弹起的信息
}
} }
//增加房间火热值hot_value //增加房间火热值hot_value
@@ -546,7 +556,7 @@ class GiveGift extends Model
} }
Db::commit(); Db::commit();
return ['code' => 1, 'msg' => '送礼成功', 'data' => ['gift_total' => $gift_total,'gift_user_data' =>$gift_user_data,'cp_type' => $cp_type]]; return ['code' => 1, 'msg' => '送礼成功', 'data' => ['gift_total' => $gift_total,'gift_user_data' =>$gift_user_data,'cp_type' => ['cp_type' => $cp_type,'text' => $text,'text1' => $text1]]];
} }
/* /*