コード例 #1
0
        /// <summary>
        /// 创建或更新每日分析
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public async Task InsertOrUpdateAdvertStatisticAsync(AdvertStatisticImport dto)
        {
            //统计日期
            var statistics = await GetAdvertStatistics(dto.ProductId, dto.AdvertAccountId, dto.StatisticOnUtc);

            if (statistics == null)
            {
                statistics = new AdvertDailyStatistic()
                {
                    StatisticOn     = dto.StatisticOnUtc,
                    ProductId       = dto.ProductId,
                    ProductName     = dto.ProductName,
                    AdvertAccountId = dto.AdvertAccountId,
                };
                await CreateAsync(statistics);
            }

            statistics.ClickNum      = dto.ClickNum;
            statistics.DisplayNum    = dto.DisplayNum;
            statistics.TotalCost     = dto.TotalCost;
            statistics.ClickPrice    = dto.ClickPrice;
            statistics.ThDisplayCost = dto.ThDisplayCost;

            await UpdateAsync(statistics);
        }
コード例 #2
0
 /// <summary>
 /// 删除广告账户每日统计
 /// </summary>
 /// <param name="statistic"></param>
 public virtual async Task DeleteAsync(AdvertDailyStatistic statistic)
 {
     await AdvertDailyStatisticRepository.DeleteAsync(statistic);
 }
コード例 #3
0
 /// <summary>
 /// 添加广告账户每日统计
 /// </summary>
 /// <param name="statistic"></param>
 public virtual async Task CreateAsync(AdvertDailyStatistic statistic)
 {
     await AdvertDailyStatisticRepository.InsertAsync(statistic);
 }