/// <summary> /// 获取转化率漏斗图模型 /// </summary> /// <param name="stDate"></param> /// <param name="edDate"></param> /// <returns></returns> public static dynamic GetConversionFunnel(string sourceType, DateTime stDate, DateTime edDate) { DashBoardAnalyzeDAL dal = new DashBoardAnalyzeDAL(); if (sourceType == "platform") { dynamic funnel = dal.GetUsrStatusNum(stDate, edDate); ConversionFunnel funnelModel = new ConversionFunnel(); funnelModel.RegNum = funnel.RegNum; funnelModel.ActiveNum = funnel.ActiveNum; funnelModel.PayNum = funnel.PayNum; return(funnelModel); } else { //系统来源 if (sourceType.IndexOf('_') < 0) { return(dal.GetSpecFunnel(1, sourceType, stDate, edDate)); } //百度系 else if (sourceType == "market_baidu") { return(dal.GetSpecFunnel(2, sourceType, stDate, edDate)); } //安卓其它渠道 else { return(dal.GetSpecFunnel(3, sourceType, stDate, edDate)); } } }
public static string GetFunnelData(string timeType, string sourceType, DateTime stDate, DateTime edDate) { ConversionFunnel funnelModel = new ConversionFunnel(); DateTime bgTime = new DateTime(); DateTime edTime = new DateTime(); switch (timeType) { case "1m": edTime = DateTime.Now; bgTime = DateTime.Now.AddMonths(-1); break; case "3m": edTime = DateTime.Now; bgTime = DateTime.Now.AddMonths(-3); break; case "custom": bgTime = stDate; edTime = edDate; break; } //funnelModel = DashBoardAnalyzeBLL.GetConversionFunnel(sourceType,bgTime, edTime); return(CommonLib.Helper.JsonSerializeObject(DashBoardAnalyzeBLL.GetConversionFunnel(sourceType, bgTime, edTime))); }