jinwenjian 发表于 2009-6-23 12:02:24

实行点卡的存贮

以下SQL就实现点卡需要用的SQL语句
update TB_user set iDate = @date +iPoint where iPoint <> 0
update TB_user set iPonit = 0 where iPoint <> 0
--充点后自动更改时间
需要每小时运行一次的

Truncate table Temp
insert intoTemp (User) (select strAccountID from TB_user where @date >iDate and @mouth >= iMouth)
--选取过期账号
update a set a.Authority = 255
from userdate a,Account_char b,Temp c
where ((a.strUserID = (select b.strCharID1 from b where b.strAccountID = c.User )
or (a.strUserID = (select b.strCharID2 from b where b.strAccountID = c.User )
or (a.strUserID = (select b.strCharID3 from b where b.strAccountID = c.User ))
--停权过期账号

DELETE FROM userdata where struserID = (select strCharID1 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM userdata where struserID = (select strCharID3 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM userdata where struserID = (select strCharID2 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM warehouse where strAccountID = (select strCharID1 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM warehouse where strAccountID = (select strCharID3 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM warehouse where strAccountID = (select strCharID2 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM Account_char where strAccountID = (select strCharID1 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM Account_char where strAccountID = (select strCharID3 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
DELETE FROM Account_char where strAccountID = (select strCharID2 from Account_char where Account_char.strAccountID <> (select strAccountID from TB_user))
--删除不能选取的角色

  下面的是制作对应网页需要用到的SQL
充点网页
添加的变量@account,@Num,@Passage
要用的SQL语句
update a.iPoint = TB_iPoint + b.iPoint , b.iPoint = 0
from TB_user a,Point b
where a.strAccountID = @account and b.iNum = @Num and b.iPassage = @passage
--充点网页

查询剩余天数的网页
添加变量@Account
--查询剩余天数
--输出
select @date - iDate from TB_user where strAccountID = @Account

dean98 发表于 2009-10-13 12:53:48

转载也是一种文明和贡献啊

ctgwglzc 发表于 2009-10-13 15:24:20

这个是好东西
如果能显示点数就好了
toto1511 发表于 2009-6-24 22:14 http://www.kofans.cn/bbs/static/image/common/back.gif
需要BILLING系统和AU的支持吧

SHaX 发表于 2009-10-15 16:03:41

thanks for sharing

gjbation1 发表于 2009-10-16 17:12:17

好好好,多谢了
页: [1]
查看完整版本: 实行点卡的存贮