summaryrefslogtreecommitdiff
path: root/dumps/check-paid.sh
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2021-05-29 17:30:20 +0200
committeremkael <emkael@tlen.pl>2021-05-29 17:30:20 +0200
commit2eaee2fe846e27603af3df655837968cdf8e2c60 (patch)
tree379ecd688f4342880a68135b9d6ac6e9df24a11b /dumps/check-paid.sh
parentb72cbe1af6507bbe44a82930e312ace82a909280 (diff)
Script to check players' entry fee
Diffstat (limited to 'dumps/check-paid.sh')
-rwxr-xr-xdumps/check-paid.sh8
1 files changed, 8 insertions, 0 deletions
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}