mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-25 10:19:06 +01:00
Improve log api
This commit is contained in:
parent
46e1bd421a
commit
d3e5adfb3d
@ -34,10 +34,26 @@ export default define(meta, async (ps) => {
|
|||||||
|
|
||||||
if (ps.level) query.level = ps.level;
|
if (ps.level) query.level = ps.level;
|
||||||
if (ps.domain) {
|
if (ps.domain) {
|
||||||
let i = 0;
|
for (const d of ps.domain.split(' ')) {
|
||||||
for (const d of ps.domain.split('.')) {
|
const qs: any[] = [];
|
||||||
query[`domain.${i}`] = d;
|
let i = 0;
|
||||||
i++;
|
for (const sd of (d.startsWith('-') ? d.substr(1) : d).split('.')) {
|
||||||
|
qs.push({
|
||||||
|
[`domain.${i}`]: d.startsWith('-') ? { $ne: sd } : sd
|
||||||
|
});
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (d.startsWith('-')) {
|
||||||
|
if (query['$and'] == null) query['$and'] = [];
|
||||||
|
query['$and'].push({
|
||||||
|
$and: qs
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (query['$or'] == null) query['$or'] = [];
|
||||||
|
query['$or'].push({
|
||||||
|
$and: qs
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user