eloquentClass::where('is_active', true) ->orderBy('id') ->get() ->toArray(); } /** * 根据条件代码获取条件 * * @param string $code 条件代码 * @return TaskCondition|null 条件对象 */ public function getByCode(string $code): ?TaskCondition { return $this->eloquentClass::where('code', $code) ->where('is_active', true) ->first(); } }