Beispiel #1
0
        /// <summary>
        /// 博客之星(去几天之内的日志访问量最多的一个)
        /// </summary>
        /// <param name="Length"></param>
        /// <returns></returns>
        public static IEnumerable<Weblog_User> GetTopUsersInAnyDay(int Length, int Days)
        {
            string ToDays = DateTime.Now.AddDays(-Days).ToString();
            string Sqlstr = "SELECT top " + Length.ToString() + " * " +
            " FROM [NCUHOME2006].[dbo].[Weblog_User]" +
            " where User_Id in (select top 20 Log_UserId" +
            " from dbo.Weblog_Log where Log_IsDraft=0 and  Log_IsPasssword=0 and Log_IsVisible =1 and log_CreateTime <='" + DateTime.Now + "'" +
            " and Log_CreateTime>'" + ToDays + "'" +
            " group by Log_UserId" +
            " order by sum(Log_ViewCount)  desc) and User_TxzId<200000  ";
            BlogDataDataContext BD = new BlogDataDataContext();
            return BD.ExecuteQuery<Weblog_User>(Sqlstr, "");

        }