nk = strTemp
End Function
''================================================
''函数名:LoadStatistic
''作 用:装载频道统计
''参 数:moduleid ----所属模块
'' ChannelID ----频道ID
'' strClass ----所调用的分类ID或者软件类型
'' stype ----统计类型,0=全部统计,1=今日更新统计,2=点击数统计,3=软件容量统计
''================================================
Public Function LoadStatistic(ByVal moduleid, ByVal ChannelID, ByVal strClass, ByVal stype)
moduleid = Newasp.CheckNumeric(moduleid)
ChannelID = Newasp.CheckNumeric(ChannelID)
stype = Newasp.CheckNumeric(stype)
Dim Rs, SQL, StatCount
Dim foundsql, ClassID, ChildStr
ClassID = Newasp.CheckNumeric(strClass)
On Error Resume Next
LoadStatistic = 0
If ClassID > 0 Then
SQL = "SELECT ChildStr FROM [NC_Classify] WHERE ChannelID = " & ChannelID & " And ClassID=" & ClassID
Set Rs = Newasp.Execute(SQL)
If Rs.BOF And Rs.EOF Then
ChildStr = 0
Else
ChildStr = Rs("ChildStr")
End If
Rs.Close: Set Rs = Nothing
foundsql = "And ChannelID=" & ChannelID & " And ClassID in (" & ChildStr & ")"
Else
foundsql = "And ChannelID=" & ChannelID
End If
Select Case moduleid
Case 1
If stype = 1 Then
If isSqlDataBase = 1 Then
SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql & " And Datediff(d,WriteTime,GetDate())=0"
Else
SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql & " And WriteTime>=Date()"
End If
ElseIf stype = 2 Then
SQL = "SELECT SUM(AllHits) FROM NC_Article WHERE isAccept>0 " & foundsql
ElseIf stype = 4 Then
SQL = "SELECT SUM(DayHits) FROM NC_Article WHERE isAccept>0 " & foundsql
Else
SQL = "SELECT COUNT(ArticleID) FROM NC_Article WHERE isAccept>0 " & foundsql
End If
Case 2
If Not IsNumeric(strClass) Then
foundsql = foundsql & " And SoftType=''" & Newasp.CheckStr(strClass) & "''"
End If
If stype = 1 Then
If isSqlDataBase = 1 Then
SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql & " And Datediff(d,SoftTime,GetDate())=0"
Else
SQL = "SELECT COUNT(softid) FROM NC_SoftList WHERE isAccept>0 " & foundsql & " And SoftTime>=Date()"
End If
ElseIf stype = 2 Then
SQL = "SELECT SUM(AllHits) FROM NC_SoftList WHERE isAccept>0 " & foundsql
ElseIf stype = 3 Then
SQL = "SELECT SUM(SoftSize) FROM NC_SoftList WHERE isAccept>0 " & foundsql