今天上午本人对商城系统进行二次开发,满足了以上需求
用户的积分的历史明细的记录、查看。
管理员后台的对用户的积分进行手工增加和修改等
数据库里新加了个表KS_LogScore,作为积分历史明细记录。
在“KS_CLS/Kesion.CommonCls.asp”文件里加了个会员积分明细出入函数:
'修改 庄昌平 2009-5-8 开始
'功能:会员积分明细出入函数 '参数:Channelid-模块ID,InfoID-信息ID,UserName-用户名,InOrOutFlag-操作类型1收入2支出,Score-积分数量,User-操作员,Descript-操作备注
Public Function ScoreInOrOut(ChannelID,InfoID,UserName,InOrOutFlag,Score,User,Descript)
If Not IsNumeric(InOrOutFlag) Or Not IsNumeric(Score) Or Score=0 Then ScoreInOrOut=false:Exit Function
Dim ScoreParam
If InOrOutFlag=1 Then
ScoreParam="Set Score=Score+" & Score
ElseIF InOrOutFlag=2 Then
ScoreParam="Set Score=Score-" & Score
Else
ScoreInOrOut=false:Exit Function
End If
on error resume next
Conn.Execute("Update KS_User " & ScoreParam & " Where UserName='" & UserName & "'")
Conn.Execute("Insert into KS_LogScore(ChannelID,InfoID,UserName,InOrOutFlag,Score,Times,[User],Descript,Adddate,IP) values(" & ChannelID & "," & InfoID & ",'" & UserName & "',"& InOrOutFlag & "," & Score & ",1,'" & replace(User,"'","""") & "','" & replace(Descript,"'","""") & "'," & SqlNowString & ",'" & replace(getip,"'","""") & "')")
IF Err Then ScoreInOrOut=false Else ScoreInOrOut=true
End Function
'修改 庄昌平 2009-5-8 结束
其他地方有多处修改和新加文件。
想了解的朋友可以加这个QQ群来索取源码:65878267