diff options
author | emkael <emkael@tlen.pl> | 2021-05-29 17:30:20 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2021-05-29 17:30:20 +0200 |
commit | 2eaee2fe846e27603af3df655837968cdf8e2c60 (patch) | |
tree | 379ecd688f4342880a68135b9d6ac6e9df24a11b | |
parent | b72cbe1af6507bbe44a82930e312ace82a909280 (diff) |
Script to check players' entry fee
-rw-r--r-- | .envrc | bin | 353 -> 400 bytes | |||
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | dumps/.paid-queries | 7 | ||||
-rwxr-xr-x | dumps/check-all-paid.sh | 6 | ||||
-rwxr-xr-x | dumps/check-paid.sh | 8 |
5 files changed, 24 insertions, 0 deletions
Binary files differ @@ -6,6 +6,9 @@ pull: autocommit: pull @cd http && git diff --quiet || (date && git add . && git commit -m 'Autocommit' && GIT_SSH_COMMAND="ssh ${LIGA_SSH_OPTS}" git push -q) +paid: players FORCE + ./dumps/check-all-paid.sh + dumps: FORCE s3cmd -c dumps/.s3config sync ${LIGA_S3_BUCKET} dumps/sync/ ./dumps/load-dumps.sh diff --git a/dumps/.paid-queries b/dumps/.paid-queries new file mode 100644 index 0000000..34d1547 --- /dev/null +++ b/dumps/.paid-queries @@ -0,0 +1,7 @@ +dmp202021_1n 6 15 +dmp202021_1s 6 15 +dmp202021_2ne 6 15 +dmp202021_2se 6 13 +dmp202021_2nw 6 15 +dmp202021_2sw 6 15 +dmp202021_e 8 15 diff --git a/dumps/check-all-paid.sh b/dumps/check-all-paid.sh new file mode 100755 index 0000000..13082c3 --- /dev/null +++ b/dumps/check-all-paid.sh @@ -0,0 +1,6 @@ +#!/bin/bash +cd $(dirname $0) +cat .paid-queries | while read PARAMS +do + ./check-paid.sh $PARAMS +done diff --git a/dumps/check-paid.sh b/dumps/check-paid.sh new file mode 100755 index 0000000..e89d937 --- /dev/null +++ b/dumps/check-paid.sh @@ -0,0 +1,8 @@ +#!/bin/bash +DBNAME=$1 +PLAYERSDB=${LIGA_PLAYERS_DB_NAME} +ROUNDFROM=$2 +ROUNDTO=$3 +echo $DBNAME +QUERY="SELECT dmpplayers.id, dmpplayers.gname, dmpplayers.sname, dmpplayers.link, teams.fullname, segments.rnd, segments.segment FROM $DBNAME.butler butler JOIN $DBNAME.players dmpplayers ON dmpplayers.id = butler.id JOIN $PLAYERSDB.players players ON players.id = dmpplayers.link JOIN $DBNAME.teams teams ON teams.id = dmpplayers.team JOIN (SELECT rnd, segment, openN as pl FROM $DBNAME.segments UNION SELECT rnd, segment, openE as pl FROM $DBNAME.segments UNION SELECT rnd, segment, openW as pl FROM $DBNAME.segments UNION SELECT rnd, segment, openS as pl FROM $DBNAME.segments UNION SELECT rnd, segment, closeN as pl FROM $DBNAME.segments UNION SELECT rnd, segment, closeE as pl FROM $DBNAME.segments UNION SELECT rnd, segment, closeW as pl FROM $DBNAME.segments UNION SELECT rnd, segment, closeS as pl FROM $DBNAME.segments) segments ON segments.pl = dmpplayers.id WHERE players.flag2 <> 'T' AND segments.rnd >= $ROUNDFROM AND segments.rnd <= $ROUNDTO;" +echo $QUERY | mysql ${LIGA_MYSQL_CONNECTION_OPTS} |