where(function (Builder $keep) use ($explicitColumn, $companyPlanColumn): void { $keep->where($explicitColumn, self::NO) ->orWhere(function (Builder $inferred) use ($explicitColumn, $companyPlanColumn): void { $inferred->where(function (Builder $blank) use ($explicitColumn): void { $blank->whereNull($explicitColumn)->orWhere($explicitColumn, ''); }) ->whereNotNull($companyPlanColumn) ->where($companyPlanColumn, '<>', '') ->where($companyPlanColumn, 'not like', '%保留%'); }); }); } }