request->request('actId',0); if (!$actId){ $this->success('活动未开始',['code'=>201]); } $res['award_list'] = CardFlipService::instance()->getCardAwardList($actId); $res['win_list'] = CardFlipService::instance()->winList($actId); $userInfo = UserService::instance()->getUserInfo(); $res['record_award'] = CardFlipService::instance()->getMyAward($actId,$userInfo->id); $this->success('返回成功',$res); } public function lottery() { $actId = $this->request->request('actId',0); $userInfo = UserService::instance()->getUserInfo(); $redisKey = ActivityConstants::CARD_USER_LOTTERY_KEY.$userInfo->id; $isHave = Redis::instance()->setnx($redisKey,1); if (!$isHave){ $this->result([],4,'请稍后重试','json'); } Redis::instance()->expire($redisKey,3); $res = CardFlipService::instance()->lottery($actId,$userInfo); $this->result($res['data'],$res['code'],'','json'); } }