getKey(); if (empty($ids)) { return $this->response()->error('请选择要启用的计划'); } // 批量更新 $count = $this->getModel()::whereIn('id', $ids)->update(['is_enabled' => 1]); return $this->response() ->success("成功启用 {$count} 个计划") ->refresh(); } catch (\Exception $e) { return $this->response() ->error('批量启用失败:' . $e->getMessage()); } } /** * 确认对话框 */ public function confirm() { return [ '确认批量启用?', '此操作将启用选中的所有清理计划。' ]; } }