Last active
August 3, 2020 14:08
-
-
Save aonrobot/fc1b34825b9527ac7246d60fd0cf35bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"size":0, | |
"query":{ | |
"bool":{ | |
"must":[ | |
{ | |
"range":{ | |
"game_date":{ | |
"gte":"2020-05-01T11:00:00.000Z", | |
"lt":"2020-05-30T11:00:00.000Z" | |
} | |
} | |
}, | |
{ | |
"term":{ | |
"lv_2":"CO5234567890sdfghjcvbnm4567" | |
} | |
}, | |
{ | |
"bool":{ | |
"should":[ | |
{ | |
"term":{ | |
"game":"MMM" | |
} | |
}, | |
{ | |
"term":{ | |
"game":"GAME" | |
} | |
}, | |
{ | |
"term":{ | |
"game":"MULTI_PLAYER" | |
} | |
}, | |
{ | |
"term":{ | |
"game":"MM" | |
} | |
}, | |
{ | |
"bool":{ | |
"must":[ | |
{ | |
"term":{ | |
"game":"FOOTBALL" | |
} | |
}, | |
{ | |
"bool":{ | |
"should":[ | |
{ | |
"term":{ | |
"source":"FIFA" | |
} | |
}, | |
{ | |
"term":{ | |
"source":"FM" | |
} | |
}, | |
{ | |
"term":{ | |
"source":"F2F" | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
} | |
] | |
} | |
}, | |
{ | |
"terms":{ | |
"status":[ | |
"DONE", | |
"REJECTED", | |
"CANCELLED" | |
] | |
} | |
} | |
] | |
} | |
}, | |
"aggs":{ | |
"report":{ | |
"terms":{ | |
"field":"lv_3", | |
"size":100 | |
}, | |
"aggs":{ | |
"gross_comm":{ | |
"sum":{ | |
"script":{ | |
"lang":"painless", | |
"source":"if (doc['valid_amount'].size() != 0 && doc['commission'].size() != 0) {(doc['valid_amount'].value * (doc['com_co'].value / 100.000))}" | |
} | |
} | |
}, | |
"amount":{ | |
"sum":{ | |
"field":"amount" | |
} | |
}, | |
"valid_amount":{ | |
"sum":{ | |
"field":"valid_amount" | |
} | |
}, | |
"superadmin_com":{ | |
"sum":{ | |
"field":"com_sa" | |
} | |
}, | |
"superadmin_ll_com":{ | |
"sum":{ | |
"field":"com_sa_ll_com" | |
} | |
}, | |
"company_com":{ | |
"sum":{ | |
"field":"com_co" | |
} | |
}, | |
"company_ll_com":{ | |
"sum":{ | |
"field":"com_co_ll_com" | |
} | |
}, | |
"senior_ll":{ | |
"sum":{ | |
"field":"com_sr" | |
} | |
}, | |
"senior_com":{ | |
"sum":{ | |
"field":"com_sr_ll_com" | |
} | |
}, | |
"member_ll":{ | |
"sum":{ | |
"field":"com_mb_ll" | |
} | |
}, | |
"member_com":{ | |
"sum":{ | |
"field":"com_mb_com" | |
} | |
} | |
} | |
} | |
} | |
} |
Author
aonrobot
commented
Aug 3, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment