标记已过期'; /** * 判断是否允许显示此操作 * * @return bool */ public function allowed() { return $this->row->reward_status === REWARD_STATUS::NOT_CLAIMED; } /** * 处理请求 * * @param Request $request * @return mixed */ public function handle(Request $request) { try { $id = $this->getKey(); $participation = ActivityParticipation::findOrFail($id); if ($participation->reward_status !== REWARD_STATUS::NOT_CLAIMED) { return $this->response()->error('只有未领取的奖励才能标记为已过期'); } $participation->reward_status = REWARD_STATUS::EXPIRED; $participation->save(); return $this->response() ->success("参与记录 [{$id}] 的奖励已标记为已过期") ->refresh(); } catch (\Exception $e) { return $this->response() ->error('操作失败: ' . $e->getMessage()); } } /** * 确认信息 * * @return array|string|void */ public function confirm() { return ['确定要标记此奖励为已过期吗?', '标记已过期后,用户将无法领取奖励']; } }