This commit is contained in:
Enno Rehling 2002-03-19 22:34:45 +00:00
parent 918c90584d
commit 0cff724930
4 changed files with 21 additions and 9 deletions

View File

@ -3,5 +3,5 @@ select users.id, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, s
where subscriptions.user=users.id
and games.id=subscriptions.game
and subscriptions.race=races.race
and games.id=1
and games.id=1 and subscriptions.status='ACTIVE'
order by subscriptions.id;

View File

@ -3,5 +3,5 @@ select users.id, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, s
where subscriptions.user=users.id
and games.id=subscriptions.game
and subscriptions.race=races.race
and games.id=2
and games.id=2 and subscriptions.status='ACTIVE'
order by subscriptions.id;

View File

@ -1,3 +1,14 @@
#!/usr/bin/python
import sys
print sys.argv[0], sys.argv[1]
import MySQLdb;
db=MySQLdb.connect(db='vinyambar');
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)))

View File

@ -1,6 +1,7 @@
select u.id ID, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, sum(t.balance) Kontostand
from users u, transactions t
where u.id=t.user
select distinct u.id ID, left(concat(firstname,' ',lastname, ' <',email,'>'),43) Name, sum(t.balance) Kontostand
from users u, transactions t, subscriptions s
where u.id=t.user and u.id=s.user
and u.status!='CONFIRMED'
and s.status='ACTIVE'
GROUP BY u.id
HAVING SUM(t.balance)<2.5;