private const string PLUGIN_PAYMENT_ALIPAY = "Himall.Plugin.Payment.Alipay";
private static IBillingService _iBillingService = ObjectContainer.Current.Resolve<IBillingService>();
private static ISiteSettingService _iSiteSettingService = ObjectContainer.Current.Resolve<ISiteSettingService>();
private static IMemberCapitalService _iMemberCapitalService = ObjectContainer.Current.Resolve<IMemberCapitalService>();
/// <summary>
/// 根据ShopID获取该店铺的财务总览信息
/// </summary>
/// <param name="shopId">店铺ID</param>
/// <returns></returns>
public static ShopAccount GetShopAccount(long shopId)
{
if (shopId == 0)
{
throw new Core.HimallException("错误的店铺ID");
}
var model = _iBillingService.GetShopAccount(shopId);
var shopAccount = Mapper.Map<ShopAccountInfo, ShopAccount>(model);
return shopAccount;
}
/// <summary>
/// 获取平台帐户信息
/// </summary>
/// <returns></returns>
public static PlatAccount GetPlatAccount()
{
var model = _iBillingService.GetPlatAccount();
Mapper.CreateMap<PlatAccountInfo, PlatAccount>();
var platAccount = Mapper.Map<PlatAccountInfo, PlatAccount>(model);
return platAccount;
}
/// <summary>
/// 获取首页交易额图表
/// </summary>
public static LineChartDataModel<decimal> GetTradeChart(DateTime start, DateTime end, long? shopId)
{
start = start.Date;
end = end.Date;
var model = _iBillingService.GetTradeChart(start, end, shopId);
return model;
}
/// <summary>
/// 获取本月交易额图表
/// </summary>
public static LineChartDataModel<decimal> GetTradeChartMonth(DateTime start, DateTime end, long? shopId)
{
start = start.Date;
end = end.Date;
var model = _iBillingService.GetTradeChartMonth(start, end, shopId);
return model;
}