Skip to content
Snippets Groups Projects
Unverified Commit 2d5158c6 authored by syuilo's avatar syuilo
Browse files

Fix bug

parent 837be06b
No related branches found
No related tags found
No related merge requests found
......@@ -57,13 +57,10 @@ export default define(meta, async (ps) => {
let i = 0;
for (const subDomain of subDomains) {
const p = `blackSubDomain_${subDomain}_${i}`;
if (i === subDomains.length - 1) {
// SQL is 1 based, so we need '+ 1'
qb.andWhere(`log.domain[${i + 1}] != :${p}`, { [p]: subDomain });
} else {
// SQL is 1 based, so we need '+ 1'
qb.andWhere(`log.domain[${i + 1}] = :${p}`, { [p]: subDomain });
}
// 全体で否定できないのでド・モルガンの法則で
// !(P && Q) を !P || !Q で表す
// SQL is 1 based, so we need '+ 1'
qb.orWhere(`log.domain[${i + 1}] != :${p}`, { [p]: subDomain });
i++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment