toArray(); return $config; } /** * @notes 更新提示词 * @param array $data * @return bool * @author 段誉 * @date 2024/12/19 10:35 */ public static function updatePrompt(array $data): bool { //查询是否存在 $prompt = ChatPrompt::where('id', $data['id'])->findOrEmpty(); if ($prompt->isEmpty()) { self::setError('提示词不存在'); return false; } $prompt->prompt_name = $data['prompt_name']; $prompt->prompt_text = $data['prompt_text']; $prompt->save(); return true; } }