From a720c696c687af77f34bfefcf955897ec4d135e4 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 11:36:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E5=8C=85=E7=AC=AC13=E6=AC=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Redpacket.php | 5 +++++ application/common/model/Redpacket.php | 1 + 2 files changed, 6 insertions(+) diff --git a/application/api/controller/Redpacket.php b/application/api/controller/Redpacket.php index b22222e..8597b4b 100644 --- a/application/api/controller/Redpacket.php +++ b/application/api/controller/Redpacket.php @@ -100,6 +100,11 @@ class Redpacket extends BaseCom { $roomId = $this->request->get('room_id'); $result = Db::name('redpacket')->where(['room_id' => $roomId, 'status' => ['<=',1]])->select(); + if($result){ + foreach ($result as $item) { + $item['redpacket_id'] = $item['id']; + } + } return V(1, '获取成功', $result); } } \ No newline at end of file diff --git a/application/common/model/Redpacket.php b/application/common/model/Redpacket.php index 3401869..f6a24b8 100644 --- a/application/common/model/Redpacket.php +++ b/application/common/model/Redpacket.php @@ -121,6 +121,7 @@ class Redpacket extends Model //给前端推送信息 $data['nickname'] = Db::name('user')->where('id', $data['user_id'])->value('nickname'); + $data['redpacket_id'] = $redpacketId; $text = [ 'redpacketInfo' => $data, 'text' => ''