|
@@ -12,16 +12,16 @@ namespace MySystem
|
|
|
#region 获取列表
|
|
|
public List<Advertisment> GetList(string ColId)
|
|
|
{
|
|
|
- string key = "AdvertismentList:" + ColId;
|
|
|
- List<Advertisment> list = new List<Advertisment>();
|
|
|
- if (RedisDbconn.Instance.Exists(key))
|
|
|
- {
|
|
|
- list = RedisDbconn.Instance.GetList<Advertisment>(key);
|
|
|
- if (list.Count > 0)
|
|
|
- {
|
|
|
- return list;
|
|
|
- }
|
|
|
- }
|
|
|
+ // string key = "AdvertismentList:" + ColId;
|
|
|
+ // List<Advertisment> list = new List<Advertisment>();
|
|
|
+ // if (RedisDbconn.Instance.Exists(key))
|
|
|
+ // {
|
|
|
+ // list = RedisDbconn.Instance.GetList<Advertisment>(key);
|
|
|
+ // if (list.Count > 0)
|
|
|
+ // {
|
|
|
+ // return list;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
List<Advertisment> newlist = new List<Advertisment>();
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
var mysqllist = db.Advertisment.Where(m => m.ColId == ColId).OrderByDescending(m => m.Sort).OrderByDescending(m => m.Id).ToList();
|
|
@@ -31,11 +31,6 @@ namespace MySystem
|
|
|
{
|
|
|
newlist.Add(sub);
|
|
|
}
|
|
|
- RedisDbconn.Instance.Clear(key);
|
|
|
- foreach (Advertisment sub in newlist)
|
|
|
- {
|
|
|
- RedisDbconn.Instance.AddRightList(key, sub);
|
|
|
- }
|
|
|
}
|
|
|
db.Dispose();
|
|
|
return newlist;
|