forked from github/server
updates
This commit is contained in:
parent
918c90584d
commit
0cff724930
|
@ -3,5 +3,5 @@ select users.id, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, s
|
||||||
where subscriptions.user=users.id
|
where subscriptions.user=users.id
|
||||||
and games.id=subscriptions.game
|
and games.id=subscriptions.game
|
||||||
and subscriptions.race=races.race
|
and subscriptions.race=races.race
|
||||||
and games.id=1
|
and games.id=1 and subscriptions.status='ACTIVE'
|
||||||
order by subscriptions.id;
|
order by subscriptions.id;
|
||||||
|
|
|
@ -3,5 +3,5 @@ select users.id, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, s
|
||||||
where subscriptions.user=users.id
|
where subscriptions.user=users.id
|
||||||
and games.id=subscriptions.game
|
and games.id=subscriptions.game
|
||||||
and subscriptions.race=races.race
|
and subscriptions.race=races.race
|
||||||
and games.id=2
|
and games.id=2 and subscriptions.status='ACTIVE'
|
||||||
order by subscriptions.id;
|
order by subscriptions.id;
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
#!/usr/bin/python
|
import MySQLdb;
|
||||||
import sys
|
db=MySQLdb.connect(db='vinyambar');
|
||||||
print sys.argv[0], sys.argv[1]
|
c=db.cursor()
|
||||||
|
users=c.execute('select id from users')
|
||||||
|
while users>0:
|
||||||
|
users=users-1
|
||||||
|
c2=db.cursor()
|
||||||
|
user=c.fetchone()[0]
|
||||||
|
a=c2.execute('select id from transactions where user='+str(int(user)))
|
||||||
|
if a>0:
|
||||||
|
c2.execute("update users set status='PAYING' where id="+str(int(user)))
|
||||||
|
else:
|
||||||
|
c2.execute("update users set status='CONFIRMED' where id="+str(int(user)))
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
select u.id ID, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, sum(t.balance) Kontostand
|
select distinct u.id ID, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, sum(t.balance) Kontostand
|
||||||
from users u, transactions t
|
from users u, transactions t, subscriptions s
|
||||||
where u.id=t.user
|
where u.id=t.user and u.id=s.user
|
||||||
and u.status!='CONFIRMED'
|
and u.status!='CONFIRMED'
|
||||||
|
and s.status='ACTIVE'
|
||||||
GROUP BY u.id
|
GROUP BY u.id
|
||||||
HAVING SUM(t.balance)<2.5;
|
HAVING SUM(t.balance)<2.5;
|
||||||
|
|
Loading…
Reference in New Issue