diff options
Diffstat (limited to 'dumps/check-paid.sh')
-rwxr-xr-x | dumps/check-paid.sh | 8 |
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} |