diff --git a/application/api/controller/Redpacket.php b/application/api/controller/Redpacket.php index 51741e4..5df6159 100644 --- a/application/api/controller/Redpacket.php +++ b/application/api/controller/Redpacket.php @@ -72,7 +72,7 @@ class Redpacket extends BaseCom */ public function detail() { - $redpacketId = $this->request->get('redpacket_id'); + $redpacketId = $this->request->post('redpacket_id'); if (empty($redpacketId)) { return V(0, '红包ID不能为空'); diff --git a/application/common/service/RedpacketService.php b/application/common/service/RedpacketService.php index 1f3f6a6..d89e869 100644 --- a/application/common/service/RedpacketService.php +++ b/application/common/service/RedpacketService.php @@ -93,7 +93,14 @@ class RedpacketService 'msg' => '已经抢过该红包', 'data' => ['code' => 2] //1-抢到了,2-已经抢过红包,3-没有抢到 ]; - }else{ + }elseif ($message == '红包已结束') { + return [ + 'code' => 1, + 'msg' => '手慢了,红包已抢完', + 'data' => ['code' => 3] //1-抢到了,2-已经抢过红包,3-没有抢到 + ]; + } + else{ return [ 'code' => 0, 'msg' => $message,