eloquentClass::where('task_id', $taskId); if ($conditionType) { $query->where('condition_type', $conditionType); } return $query->orderBy('sort_order') ->get() ->toArray(); } /** * 获取指定任务的所有必要达成条件 * * @param int $taskId 任务ID * @return array 必要达成条件列表 */ public function getRequiredConditionsByTaskId(int $taskId): array { return $this->eloquentClass::where('task_id', $taskId) ->where('is_required', true) ->orderBy('sort_order') ->get() ->toArray(); } }