From f50609fffe03dd9c31db308aa47c66826b464ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Mon, 13 Oct 2025 16:13:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=A8=E9=80=81=E7=BB=99=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=20=E7=BA=A2=E5=8C=85=E4=BF=A1=E6=81=AF=E9=87=8C?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E5=BC=80=E6=8A=A2?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/model/Redpacket.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/common/model/Redpacket.php b/application/common/model/Redpacket.php index 3d2ea7e..850f1bf 100644 --- a/application/common/model/Redpacket.php +++ b/application/common/model/Redpacket.php @@ -124,6 +124,7 @@ class Redpacket extends Model $data['nickname'] = Db::name('user')->where('id', $data['user_id'])->value('nickname'); $data['avatar'] = Db::name('user')->where('id', $data['user_id'])->value('avatar'); $data['redpacket_id'] = $redpacketId; + $data['start_time'] = $startTime; $text = [ 'redpacketInfo' => $data, 'text' => '' From 73853615211512e583d2ad20e59bff0ac89f3d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Mon, 13 Oct 2025 16:21:37 +0800 Subject: [PATCH 2/2] =?UTF-8?q?MQTT=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Push.php | 8 ++++++++ application/common/model/Redpacket.php | 3 +++ 2 files changed, 11 insertions(+) diff --git a/application/common/controller/Push.php b/application/common/controller/Push.php index 6134743..067a200 100644 --- a/application/common/controller/Push.php +++ b/application/common/controller/Push.php @@ -75,6 +75,8 @@ class Push const PUSH_ROOM_PAN_XLH_PROGRESS = 8000; //小时榜 const PUSH_ROOM_PAN_HOUR_PROGRESS = 8001; + //红包 + const PUSH_ROOM_PAN_RED_PROGRESS = 8002; public $user_id, $room_id, $topic_room, $topic_client; @@ -307,6 +309,12 @@ class Push $this->push(self::PUSH_ROOM_PAN_HOUR_PROGRESS, $topic, $data); } + //红包来了 + public function redpacketArrive($data){ + $topic = 'qx_redpacket_arrive'; + $this->push(self::PUSH_ROOM_PAN_RED_PROGRESS, $topic, $data); + } + // =========================================秘地使用结束===================================================== diff --git a/application/common/model/Redpacket.php b/application/common/model/Redpacket.php index 850f1bf..9a11f87 100644 --- a/application/common/model/Redpacket.php +++ b/application/common/model/Redpacket.php @@ -2,6 +2,7 @@ namespace app\common\model; +use app\common\controller\Push; use think\Model; use think\Db; @@ -130,6 +131,8 @@ class Redpacket extends Model 'text' => '' ]; model('api/Chat')->sendMsg(1060,$data['room_id'],$text); + $push = new Push(UID, $data['room_id']); + $push->redpacketArrive($data); return ['code' => 1, 'msg' => '发红包成功', 'data' => $redpacketId];