private void Bind()
        {
            ltStime.Text   = txtTime.Value;
            ltAdTitle.Text = ddlAdPage.SelectedItem.Text;

            QcodeQueryInfo query = new QcodeQueryInfo();

            query.Time     = int.Parse(DN.WeiAd.Framework.TimeHelper.ConverTimeByString(txtTime.Value).ToString("yyyyMMdd"));
            query.GroupBy  = " time ";
            query.OrderBy  = "time desc ";
            query.AdUserId = Account.UserId;

            if (!string.IsNullOrEmpty(ddlAdPage.SelectedValue))
            {
                query.AdId = int.Parse(ddlAdPage.SelectedValue);
            }


            DataTable table = LogAdQcodeBLL.Instance.GetAnalysis(query);

            if (table.Rows.Count != 0)
            {
                ltIp.Text = table.Rows[0]["ipcount"].ToString();
                ltPv.Text = table.Rows[0]["pvcount"].ToString();
                ltUv.Text = table.Rows[0]["uvcount"].ToString();

                ltIp1.Text = table.Rows[0]["ipcount"].ToString();
                ltPv1.Text = table.Rows[0]["pvcount"].ToString();
                ltUv1.Text = table.Rows[0]["uvcount"].ToString();
            }
            else
            {
                ltIp.Text = "0";
                ltPv.Text = "0";
                ltUv.Text = "0";

                ltIp1.Text = "0";
                ltPv1.Text = "0";
                ltUv1.Text = "0";
            }

            DataTable table1 = LogAdQcodeBLL.Instance.GetBrowseHour(query);

            int hour = int.Parse(DateTime.Now.ToString("HH"));

            if (query.Time.Value != int.Parse(DateTime.Now.ToString("yyyyMMdd")))
            {
                hour = 24;
            }
            var chart = ChartComonBLL.GetAdBrowseHour(table1, hour);

            hidDataJson.Value = DN.Framework.Utility.Serializer.SerializeObject(chart);

            rptTable.DataSource = table1;
            rptTable.DataBind();
        }
        private void Bind(int pageIndex = 1)
        {
            QcodeQueryInfo query = new QcodeQueryInfo();

            query.GroupBy = "time";
            var list = LogAdQcodeBLL.Instance.GetAnalysis(query);

            rptTable.DataSource = list;
            rptTable.DataBind();
        }
Example #3
0
        /// <summary>
        /// 通用汇总,groupby必须填写
        /// </summary>
        /// <param name="flow"></param>
        /// <returns></returns>
        public DataTable GetAnalysis(QcodeQueryInfo flow)
        {
            StringBuilder sb = new StringBuilder();

            if (flow.AdId.HasValue)
            {
                sb.AppendFormat(" and AdId = {0} ", flow.AdId);
            }
            if (flow.AdUserId.HasValue)
            {
                sb.AppendFormat(" and AdUserId = {0} ", flow.AdUserId);
            }
            if (!string.IsNullOrEmpty(flow.Url))
            {
                sb.AppendFormat(" and Url = '{0}' ", flow.Url);
            }
            if (flow.Time.HasValue)
            {
                sb.AppendFormat(" and time = {0} ", flow.Time.Value);
            }

            if (flow.TimeStart.HasValue)
            {
                sb.AppendFormat(" and time >= {0} ", flow.TimeStart.Value.ToString("yyyyMMdd"));
            }
            if (flow.TimeEnd.HasValue)
            {
                sb.AppendFormat(" and time <= {0} ", flow.TimeEnd.Value.ToString("yyyyMMdd"));
            }

            string orderby = "";

            if (!string.IsNullOrEmpty(flow.OrderBy))
            {
                orderby = string.Format(" order by {0} ", flow.OrderBy);
            }

            string cmd = string.Format(@"
select 
{1}
,count(*) as pvcount
,count(distinct(clientid)) as uvcount
,count(distinct(clientip)) as ipcount  
from  [LogAdQcode]
where 1=1 {0}
group by {1} {2}", sb, flow.GroupBy, orderby);

            ChartPara cp = new ChartPara();

            cp.CommandText = cmd;
            DataTable table = chartcacc.GetTable(cp);

            return(table);
        }
Example #4
0
        private void Bind()
        {
            QcodeQueryInfo query = new QcodeQueryInfo();

            query.Time    = int.Parse(DN.WeiAd.Framework.TimeHelper.ConverTimeByString(txtTime.Value).ToString("yyyyMMdd"));
            query.GroupBy = "time,AdUserId ";
            query.OrderBy = " time desc ";

            DataTable table = LogAdQcodeBLL.Instance.GetAnalysis(query);

            rptTable.DataSource = table;
            rptTable.DataBind();
        }
Example #5
0
        private void Bind(int pageIndex = 1)
        {
            QcodeQueryInfo query = new QcodeQueryInfo();

            query.TimeStart = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-01"));
            query.TimeEnd   = DateTime.Now;
            query.GroupBy   = "time";
            query.OrderBy   = " time desc ";
            var list = LogAdQcodeBLL.Instance.GetAnalysis(query);

            rptTable.DataSource = list;
            rptTable.DataBind();
        }
Example #6
0
        /// <summary>
        /// 分小时粒度汇总
        /// </summary>
        /// <param name="aduserid"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public DataTable GetBrowseHour(QcodeQueryInfo flow)
        {
            StringBuilder sb = new StringBuilder();

            if (flow.AdId.HasValue)
            {
                sb.AppendFormat(" and AdId = {0} ", flow.AdId);
            }
            if (flow.AdUserId.HasValue)
            {
                sb.AppendFormat(" and AdUserId = {0} ", flow.AdUserId);
            }
            if (!string.IsNullOrEmpty(flow.Url))
            {
                sb.AppendFormat(" and Url = '{0}' ", flow.Url);
            }
            if (flow.Time.HasValue)
            {
                sb.AppendFormat(" and time = {0} ", flow.Time.Value);
            }

            ChartPara cp = new ChartPara();

            cp.CommandText = string.Format(@"select * from (
select 
left(convert(varchar(10), CreateDate, 108), 2) as time 
,count(*) as pvcount
,count(distinct(clientid)) as uvcount
,count(distinct(clientip)) as ipcount  
from  [LogAdQcode]
where 1=1 {0}
group by left(convert(varchar(10), CreateDate, 108), 2)
) a order by a.time asc", sb);

            //数据
            DataTable table = chartcacc.GetTable(cp);

            return(table);
        }