增加 统计新接口
增加每日02时自动更新统计
This commit is contained in:
1 parent
3dac74c6c2
commit
22c7ecd4d8
24 files changed
+1895
-255
No files matched your search
@@ -0,0 +1,28 @@
|
||||
using MAX.Core.DependencyInjection;
|
||||
using Store.Framework.Jobs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
|
||||
namespace KJD_Web.Services.Shops;
|
||||
|
||||
/// <summary>
|
||||
/// 更新商铺统计
|
||||
/// </summary>
|
||||
[Job("ShopStats", "0 2 * * *")]
|
||||
public class ShopStatsJob : IScheduledJobs, ITransientDependency
|
||||
{
|
||||
private readonly ShopRevenueStatisticsService _shopRevenueStatisticsService;
|
||||
|
||||
public ShopStatsJob(ShopRevenueStatisticsService shopRevenueStatisticsService)
|
||||
{
|
||||
_shopRevenueStatisticsService = shopRevenueStatisticsService;
|
||||
}
|
||||
public Task RunAsync()
|
||||
{
|
||||
_shopRevenueStatisticsService.UpdateStats(DateTime.Now.AddDays(-1).Date);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user