using Interface; using Models; using Models.Entity.LottomatBaseDB; using Models.Views; using Services; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Business.TJ { public static class RecommendBLL { private static ZXInterface service; static RecommendBLL() { // log = new LogHelper(); service = new ZXServic(); } /// /// 获取分类下所有彩种集合 /// /// 彩种code集合(code如:QGC) /// 返回所有彩种集合 public static List GetLotteryList(List recom) { List expressionlist = new List(); List listexp = new List(); listexp.Add(new EExpression("ItemId", EnumExpression.In, recom)); for (int i = 0; i < listexp.Count; i++) { expressionlist.Add(@" AND " + listexp[i].GetSql()); } string strsql = @"SELECT [ItemDetailId] ,[ItemId] ,[ParentId] ,[ItemCode] ,[ItemName] ,[ItemValue] ,[QuickQuery] ,[SimpleSpelling] ,[IsDefault] ,[SortCode] ,[DeleteMark] ,[EnabledMark] ,[Description] ,[CreateDate] ,[CreateUserId] ,[CreateUserName] ,[IsHot] ,[IsRecommend] ,[IsShowHomePage] FROM [Base_DataItemDetail] where 1=1 {0} and DeleteMark=0 and EnabledMark=1 order by SortCode asc"; string sql = string.Format(strsql, string.Join("", expressionlist)); return service.ExSqlGetList(sql); } /// /// 友链及其底部快捷导航 /// /// public static List GetFriendLinksList() { string strsql = @"SELECT [PK] ,[ID] ,[Type] ,[TypeName] ,[Name] ,[Url] ,[IsEnable] ,[IsDelete] ,[CreateUserId] ,[CreateUserName] ,[CreateTime] ,isnull(Remark,'') as Remark ,[TermOfValidity] FROM [Base_FriendLinks] where 1=1 and IsEnable=1 and IsDelete=0"; string sql = string.Format(strsql); return service.ExSqlGetList(sql); } /// /// [Base_DataItem]表中所有数据 /// /// public static List GetDataItem() { string strsql = @"SELECT [ItemId] ,[ParentId] ,[ItemCode] ,[ItemName] ,[IsTree] ,[IsNav] ,[SortCode] ,[DeleteMark] ,[EnabledMark] ,[Description] ,[CreateDate] ,[CreateUserId] ,[CreateUserName] FROM [Base_DataItem] where 1=1 and EnabledMark=1 and DeleteMark=0"; string sql = string.Format(strsql); return service.ExSqlGetList(sql); } /// /// 得到广告 /// /// public static List GetAd() { string strsql = @"SELECT [PK] ,[ID] ,[Title] ,[Category] ,[CategoryId] ,[Position] ,[Href] ,[AddTime] ,[TermOfValidity] ,[Remark] ,[IsEnable] ,[IsDelete] FROM [Base_Advertisement] where 1=1 and isdelete= 0 and IsEnable=1 and TermOfValidity>getdate()"; string sql = string.Format(strsql); return service.ExSqlGetList(sql); } } }