From a3a8d582e543a4a016f7c22eb9015ae21747aead 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, 14 Oct 2025 12:03:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Redpacket.php | 2 +- application/common/model/Redpacket.php | 2 +- application/cron/controller/PerformPerSecond.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/api/controller/Redpacket.php b/application/api/controller/Redpacket.php index ad9a1a0..0315c69 100644 --- a/application/api/controller/Redpacket.php +++ b/application/api/controller/Redpacket.php @@ -98,7 +98,7 @@ class Redpacket extends BaseCom // 获取房间内红包列表 public function roomRedPackets() { - $roomId = $this->request->post('room_id'); + $roomId = $this->request->get('room_id'); $result = Db::name('redpacket')->where(['room_id' => $roomId, 'status' => ['<=',1]])->select(); if($result){ foreach ($result as &$item) { diff --git a/application/common/model/Redpacket.php b/application/common/model/Redpacket.php index e7359fe..fab77c2 100644 --- a/application/common/model/Redpacket.php +++ b/application/common/model/Redpacket.php @@ -100,7 +100,7 @@ class Redpacket extends Model 'start_time' => $startTime, 'end_time' => $endTime, 'createtime' => time(), - 'remark' => !empty($data['remark']) ? $data['remark'] : '大吉大利,红包拿来啦!' + 'remark' => (!empty($data['remark']) && trim($data['remark']) !== '') ? trim($data['remark']) : '大吉大利,红包拿来啦!' ]; $redpacketId = $this->insertGetId($redpacketData); diff --git a/application/cron/controller/PerformPerSecond.php b/application/cron/controller/PerformPerSecond.php index 4a689f5..b2f5dfd 100644 --- a/application/cron/controller/PerformPerSecond.php +++ b/application/cron/controller/PerformPerSecond.php @@ -242,7 +242,7 @@ class PerformPerSecond { // 查找已结束但未退款的红包 $expiredRedpackets = Db::name('redpacket') - ->where(['end_time' => ['<',time()]]) + ->where(['end_time' => ['<',time()], 'status' => 1]) ->select(); foreach ($expiredRedpackets as $redpacket) {