summaryrefslogtreecommitdiff
path: root/dumps
diff options
context:
space:
mode:
Diffstat (limited to 'dumps')
-rw-r--r--dumps/.paid-queries7
-rwxr-xr-xdumps/check-all-paid.sh6
-rwxr-xr-xdumps/check-paid.sh8
3 files changed, 21 insertions, 0 deletions
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}