summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-05-22 21:22:32 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-05-22 21:22:32 +0200
commitf2bdd5c9c41796f1887eea94576de67af6bc88e0 (patch)
tree51a18be42f1f0f25c2a7d9f80ab66c79e8659f46
parentc401f9e227e92c03e249db23159b738b1456bd6f (diff)
downloadcruncher-release/2.4.0.tar.gz
cruncher-release/2.4.0.zip
crunch build statsrelease/2.4.0
-rw-r--r--crunch_global.sql9
-rw-r--r--worker.js6
2 files changed, 13 insertions, 2 deletions
diff --git a/crunch_global.sql b/crunch_global.sql
index 7bb6263..e06c805 100644
--- a/crunch_global.sql
+++ b/crunch_global.sql
@@ -55,7 +55,14 @@ JOIN `filter` ON `filter`.`name` = 'all' AND `filter`.`dimension_on` = 'global'
JOIN `hero` ON `hero`.`id` = `participant`.`hero_id` OR `hero`.`name` = 'all'
JOIN `game_mode` ON `game_mode`.`id` = `participant`.`game_mode_id` OR `game_mode`.`name` = 'all'
JOIN `skill_tier` ON `participant`.`skill_tier` BETWEEN `skill_tier`.`start` AND `skill_tier`.`end` OR `skill_tier`.`name` = 'all'
-JOIN `build` ON `build`.`name` = 'all'
+JOIN `build` ON `build`.`name` = 'all' OR (
+ `participant_stats`.`item_grants` RLIKE CONCAT(:build_regex_start, `build`.`item_1`, :build_regex_end) AND
+ `participant_stats`.`item_grants` RLIKE CONCAT(:build_regex_start, `build`.`item_2`, :build_regex_end) AND
+ `participant_stats`.`item_grants` RLIKE CONCAT(:build_regex_start, `build`.`item_3`, :build_regex_end) AND
+ `participant_stats`.`item_grants` RLIKE CONCAT(:build_regex_start, `build`.`item_4`, :build_regex_end) AND
+ `participant_stats`.`item_grants` RLIKE CONCAT(:build_regex_start, `build`.`item_5`, :build_regex_end) AND
+ `participant_stats`.`item_grants` RLIKE CONCAT(:build_regex_start, `build`.`item_6`, :build_regex_end)
+)
JOIN `role` ON `role`.`id` = `participant`.`role_id` OR `role`.`name` = 'all'
JOIN `region` ON `region`.`name` = `participant`.`shard_id` OR `region`.`name` = 'all'
diff --git a/worker.js b/worker.js
index cece1a7..c40b216 100644
--- a/worker.js
+++ b/worker.js
@@ -115,7 +115,11 @@ if (LOGGLY_TOKEN)
if (api_ids_global.length > 0)
await seq.query(global_script, {
- replacements: { participant_api_ids: api_ids_global },
+ replacements: {
+ participant_api_ids: api_ids_global,
+ build_regex_start: '^([[:digit:]]+;[[:digit:]]+,)*(',
+ build_regex_end: ')+(,[[:digit:]]+;[[:digit:]]+)*$'
+ },
type: seq.QueryTypes.UPSERT
});
if (team_ids.length > 0) {