1,会员数据表需要有字段:
会员等级 限制条数
gradeid limit
默认值 3(普通会员) 5
类型 int int
2,关键实现:
判断当天发布信息记录的条数统计数和limit的比较
备注:
具体实现代码:
<%
if p_z_Z_Type="卖" then
set gssql1=conn.execute("select gradeid,limit from Websen_corporation where id="&gsid&"")
'set gssql1=conn.execute("select gradeid from Websen_corporation where id="&gsid&"")
gsgradeid1 =gssql1(0)
limit1 =gssql1(1)
'limit1=5
if gsgradeid1 =3 then
set totil1=conn.execute("select count(info_id) from Websen_Info where ( YEAR(limitDate) = YEAR(getdate()) AND MONTH(limitDate) = MONTH(getdate()) AND DAY(limitDate) = DAY(getdate()) ) and gsid="&gsid&" and type='卖' ")
'set totil1=conn.execute("select count(info_id) from Websen_Info where ( YEAR(dateandtime) = YEAR(getdate()) AND MONTH(dateandtime) = MONTH(getdate()) AND DAY(dateandtime) = DAY(getdate()) ) and gsid="&gsid&" and type='卖' ")
totil1=totil1(0)
totil2=limit1-totil1
if totil2=0 then
response.write"您今天已经发布了<font color=#FF0000>"&limit1&"</font>条供应信息。不能在发布供应信息了!想发布更多信息<a href=/hy.html target=_blank><font color=#FF0000>立即升级为VIP会员!</font></a>"
else
response.write"你今天还能发布<font color=#FF0000>"&totil2&"</font>条供应信息!想发布更多信息<a href=/hy.html target=_blank><font color=#FF0000>立即升级为VIP会员!</font></a>"
end if
end if
end if
%>