diff --git a/application/api/controller/Redpacket.php b/application/api/controller/Redpacket.php index 0315c69..ad9a1a0 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->get('room_id'); + $roomId = $this->request->post('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 ee84ac1..e7359fe 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']) ?? '大吉大利,红包拿来啦!' + 'remark' => !empty($data['remark']) ? $data['remark'] : '大吉大利,红包拿来啦!' ]; $redpacketId = $this->insertGetId($redpacketData);