/// <summary> /// 当前促销 /// 检查时间,如过期修过状态 /// </summary> /// <returns></returns> public static List <Lebi_Promotion_Type> CurrentPromotionType() { //return ShopCache.GetCurrentPromotionType(); List <Lebi_Promotion_Type> models = B_Lebi_Promotion_Type.GetList("Type_id_PromotionStatus=241", ""); List <Lebi_Promotion_Type> res = new List <Lebi_Promotion_Type>(); foreach (Lebi_Promotion_Type model in models) { if (model.Time_End < System.DateTime.Now) { model.Type_id_PromotionStatus = 242; B_Lebi_Promotion_Type.Update(model); continue; } res.Add(model); } return(res); }
/// <summary> /// 设置当前所有活动缓存 /// </summary> public static void SetCurrentPromotionType() { List <Lebi_Promotion_Type> models = B_Lebi_Promotion_Type.GetList("Type_id_PromotionStatus=241", ""); CacheTool.Permanent("CurrentPromotion", models); }