summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.envrcbin353 -> 400 bytes
-rw-r--r--Makefile3
-rw-r--r--dumps/.paid-queries7
-rwxr-xr-xdumps/check-all-paid.sh6
-rwxr-xr-xdumps/check-paid.sh8
5 files changed, 24 insertions, 0 deletions
diff --git a/.envrc b/.envrc
index 14188bc..abd4edb 100644
--- a/.envrc
+++ b/.envrc
Binary files differ
diff --git a/Makefile b/Makefile
index f73acfc..10748b9 100644
--- a/Makefile
+++ b/Makefile
@@ -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}