红包添加备注 和校验

This commit is contained in:
2025-10-13 15:56:46 +08:00
parent 72f56a4fb4
commit 4dcccc2896
2 changed files with 6 additions and 1 deletions

View File

@@ -450,6 +450,10 @@ class RedpacketService
return ['code' => 0, 'msg' => '用户ID不能为空', 'data' => null];
}
if (empty($data['room_id'])) {
return ['code' => 0, 'msg' => '房间ID不能为空', 'data' => null];
}
if (!in_array($data['type'], [Redpacket::TYPE_NORMAL, Redpacket::TYPE_PASSWORD])) {
return ['code' => 0, 'msg' => '红包类型错误', 'data' => null];
}