From dbda4a6887fd3144d866b2f9deada45a5d9805f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Tue, 2 Sep 2025 22:09:03 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8B=8D=E5=8D=96=E6=88=BF=20=20=E5=90=8C?= =?UTF-8?q?=E6=84=8F=E4=B8=8A=E9=BA=A6=20=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/RoomPit.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/application/api/model/RoomPit.php b/application/api/model/RoomPit.php index 39885b3..8c29bb2 100644 --- a/application/api/model/RoomPit.php +++ b/application/api/model/RoomPit.php @@ -591,14 +591,16 @@ class RoomPit extends Model //有人就让他下麦 return ['code' => 0, 'msg' => '拍卖位上已有人,请先抱对方下麦', 'data' => null]; } - $i = 0; - foreach ($to_user as &$value) { - $i++; +// $i = 0; +// foreach ($to_user as &$value) { +// $i++; + $value = $to_user[0]; //删除他的申请上麦 $reslut = db::name('vs_room_pit_apply')->where(['user_id' => $value, 'room_id' => $room_id, 'status' => 0])->delete(); - if (!$reslut) { - continue; - } +// if (!$reslut) { +// continue; +// } + Cache::set('auction_user_'.$room_id,$value); //聊天室推送系统消息 $FromUserInfo = db::name('user')->where('id',$value)->field('id as user_id,nickname,avatar,sex')->find(); $FromUserInfo['icon'][0] = model('UserData')->user_wealth_icon($value);//财富图标 @@ -609,13 +611,13 @@ class RoomPit extends Model $text['pit_number'] = 888; $text['type'] = 1 ; model('Chat')->sendMsg(1022,$room_id,$text); - Cache::set('auction_user_'.$room_id,$value); + //1-禁麦位,2-清空消息,3-清空魅力值,4-加入黑名单,5-踢出房间,6-关闭麦克风,7-申请上麦,8-同意上麦,9-拒绝上麦,10-点歌,11-开启PK', model('Room')->room_operation_record($user_id,$room_id,8,$value); - if($i >= 1){ - break; - } - } +// if($i >= 1){ +// break; +// } +// } $count = db::name('vs_room_pit_apply')->where(['room_id' => $room_id,'status' => 0])->count(); //申请上麦推送消息 $text = [ From 6d68a72144ed037b36be19b10fee4ca0c1cbb81e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 3 Sep 2025 15:50:19 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=B7=A5=E4=BC=9A=E6=8E=92=E8=A1=8C?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Ranking.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/api/model/Ranking.php b/application/api/model/Ranking.php index 455bfab..d4731ea 100644 --- a/application/api/model/Ranking.php +++ b/application/api/model/Ranking.php @@ -278,7 +278,12 @@ class Ranking extends Model } $lists = $guilds ; - $my_ranking = null; +// $my_ranking = null; + $my_ranking['guild_name'] = ''; + $my_ranking['cover'] = ''; + $my_ranking['total'] = 0; + $my_ranking['rank'] = -1; + $my_ranking['diff'] = 0; if($lists){ //获取当前用户的工会 $myGuild = db::name('vs_guild_user')->where(['user_id' => UID])->find(); From ceab1684db30af30fe80c1d52f071e25eeb771fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 3 Sep 2025 16:00:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=94=B6=E7=9B=8A=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E7=82=B9=E4=BF=9D=E7=95=994=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/common.php b/application/common.php index 9b371d7..dcfd81b 100644 --- a/application/common.php +++ b/application/common.php @@ -1102,7 +1102,10 @@ function handelCharge($where,$data){ function coin_earning($all_gift_price,$ratio){ //rmb_coin_ratio 人民币转换金币的比例 //金币转换人民币 - return $all_gift_price * $ratio / 100 / get_system_config_value('rmb_coin_ratio'); + //小数点保留4位 + $result = $all_gift_price * $ratio / 100 / get_system_config_value('rmb_coin_ratio'); + + return round($result, 4); } /** From b81ebd1f37be6431d0171cd8909f95707b214a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 3 Sep 2025 16:20:35 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BA=A4=E5=8F=8B=E5=8D=A1=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=20=E5=88=9B=E5=BB=BA=E5=B0=8F=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=BB=A7=E7=BB=AD=E8=BF=9B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Friend.php | 66 ++++++++++++++++---------------- application/common.php | 1 - 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/application/api/model/Friend.php b/application/api/model/Friend.php index 7cd981d..71931c0 100644 --- a/application/api/model/Friend.php +++ b/application/api/model/Friend.php @@ -157,44 +157,46 @@ class Friend extends Model $originalPairs = db::name('vs_user_friending_heart') ->where(['id'=>$friending_heart['id']]) ->update(['status' => 3,'friend_config_id' =>$friending_config_id]); + $msg = ''; if ($originalPairs) { $relation = db::name('vs_relation')->where('id',$friending_config_id)->value('name'); if($friending_heart['heart_value'] >= get_system_config_value('friend_heart_create_room') && $friending_config_id > 0){ //创建小房间 $room_ids = model('api/Room')->user_create_room($user1,'的电影房',get_system_config_value('web_site').'/data/avatar/head_pic.png','交友房产生的一次性房间',7); if($room_ids['code'] != 1){ - //推送给前端消息 - $text['text'] = '交友结束'; - $text['step'] = 1;//1 等待邂逅 2 心动连线 3 牵手良缘 - model('api/Chat')->sendMsg(1049,$room_id,$text); - db::rollback(); - return ['code' => 0, 'msg' => 'cp电影房创建失败,请联系管理员','data' => null]; - } + $msg = 'cp电影房创建失败'; +// //推送给前端消息 +// $text['text'] = '交友结束'; +// $text['step'] = 1;//1 等待邂逅 2 心动连线 3 牵手良缘 +// model('api/Chat')->sendMsg(1049,$room_id,$text); +// db::rollback(); +// return ['code' => 0, 'msg' => 'cp电影房创建失败,请联系管理员','data' => null]; + }else{ + //记录小房间 + $datda = [ + 'room_id' => $room_ids['data'], + 'relation_id' => $friending_config_id, + 'user_id' => $user1, + 'user_id1' => $user2, + 'time_day' => time() + get_system_config_value('friend_room_timea') * 60, + 'createtime' => time(), + 'status' => 1, + 'type' => 1 + ]; + db::name('vs_room_cp_movie')->insert($datda); - //记录小房间 - $datda = [ - 'room_id' => $room_ids['data'], - 'relation_id' => $friending_config_id, - 'user_id' => $user1, - 'user_id1' => $user2, - 'time_day' => time() + get_system_config_value('friend_room_timea') * 60, - 'createtime' => time(), - 'status' => 1, - 'type' => 1 - ]; - db::name('vs_room_cp_movie')->insert($datda); - - if($room_ids['data']){ - $text['text'] = '交友结束并创建房间'; - $text['relation_name'] = $relation; - $text['room_id'] = $room_ids['data'];//前端用来让用户跳转的房间id - $text['user1_id'] = $user1;//进小房间的用户id - $text['user2_id'] = $user2;//进小房间的用户id - $text['user1_avatar'] = db::name('user')->where(['id'=>$user1])->value('avatar'); - $text['user1_nickname'] = db::name('user')->where(['id'=>$user1])->value('nickname'); - $text['user2_avatar'] = db::name('user')->where(['id'=>$user2])->value('avatar'); - $text['user2_nickname'] = db::name('user')->where(['id'=>$user2])->value('nickname'); - model('api/Chat')->sendMsg(1051,$room_id,$text); + if($room_ids['data']){ + $text['text'] = '交友结束并创建房间'; + $text['relation_name'] = $relation; + $text['room_id'] = $room_ids['data'];//前端用来让用户跳转的房间id + $text['user1_id'] = $user1;//进小房间的用户id + $text['user2_id'] = $user2;//进小房间的用户id + $text['user1_avatar'] = db::name('user')->where(['id'=>$user1])->value('avatar'); + $text['user1_nickname'] = db::name('user')->where(['id'=>$user1])->value('nickname'); + $text['user2_avatar'] = db::name('user')->where(['id'=>$user2])->value('avatar'); + $text['user2_nickname'] = db::name('user')->where(['id'=>$user2])->value('nickname'); + model('api/Chat')->sendMsg(1051,$room_id,$text); + } } }else{ $text['text'] = '交友结束未创建房间'; @@ -227,7 +229,7 @@ class Friend extends Model $text['step'] = 1;//1 等待邂逅 2 心动连线 3 牵手良缘 model('api/Chat')->sendMsg(1049,$room_id,$text); db::commit(); - return ['code' => 1, 'msg' => '创建关系成功', 'data' => null]; + return ['code' => 1, 'msg' => '创建关系成功!'.$msg, 'data' => null]; } else { //推送给前端消息 $text['text'] = '交友结束'; diff --git a/application/common.php b/application/common.php index dcfd81b..6c39f82 100644 --- a/application/common.php +++ b/application/common.php @@ -1104,7 +1104,6 @@ function coin_earning($all_gift_price,$ratio){ //金币转换人民币 //小数点保留4位 $result = $all_gift_price * $ratio / 100 / get_system_config_value('rmb_coin_ratio'); - return round($result, 4); } From 1c8ca65dd5db6d187b39ace1e4074201c85c90ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 3 Sep 2025 17:19:49 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BA=A4=E5=8F=8B=E5=8D=A1=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=20=E5=88=9B=E5=BB=BA=E5=B0=8F=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=BB=A7=E7=BB=AD=E8=BF=9B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Friend.php | 10 ++++++---- application/common.php | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/application/api/controller/Friend.php b/application/api/controller/Friend.php index b60314e..df4973f 100644 --- a/application/api/controller/Friend.php +++ b/application/api/controller/Friend.php @@ -8,10 +8,11 @@ class Friend extends BaseCom { //交友开始 public function start_friend(){ + $key_name = "api:friend:start_friend:" . $this->uid; + redis_lock_exits($key_name); $room_id = input('room_id', ''); - $reslut = model('Friend')->start_friend($this->uid,$room_id); - + redis_unlocks($key_name); return V($reslut['code'], $reslut['msg'], $reslut['data']); } @@ -40,14 +41,15 @@ class Friend extends BaseCom //卡关系 创建关系 public function create_relation() { + $key_name = "api:friend:create_relation:" . $this->uid; + redis_lock_exits($key_name); $room_id = input('room_id', ''); $friend_id = input('friend_id', ''); $user1_id = input('user1_id', ''); $user2_id = input('user2_id', ''); $relation_id = input('relation_id', ''); - $result = model('Friend')->createRelation($this->uid,$room_id,$friend_id,$user1_id,$user2_id,$relation_id); - + redis_unlocks($key_name); return V($result['code'], $result['msg'], $result['data']); } diff --git a/application/common.php b/application/common.php index 6c39f82..2269b62 100644 --- a/application/common.php +++ b/application/common.php @@ -5,6 +5,7 @@ use think\Cache; use think\Db; use think\exception\HttpResponseException; +use think\Log; use think\Response; if (!function_exists('__')) {