原代码:
<%
'更新每周每日数据
lasthit=rs("lasthit")
tdate=year(Now()) & "-" & month(Now()) & "-" & day(Now())
if trim(lasthit)=trim(tdate) then
sql="update download set dayhit=dayhit+1 where id="&request("id")
conn.Execute(sql)
' response.write "success"
else
sql="update download set dayhit=1 where id="&request("id")
conn.Execute(sql)
' response.write "error"
end if
sql="update download set lasthit='"&tdate&"' where ID="&request("id")
conn.Execute(sql)
p_year=CInt(year(Now()))-CInt(year(lasthit))
p_month=CInt(month(Now()))-CInt(month(lasthit))
p_day=CInt(day(Now()))-CInt(day(lasthit))
period_time=((p_year*12+p_month)*30+p_day)
if cint(period_time)=<cint(7) then
sql="update download set weekhit=weekhit+1 where id="&request("id")
conn.Execute(sql)
else
sql="update download set weekhit=1 where id="&request("id")
conn.Execute(sql)
end if
%>