| | |
| | | using CoreCms.Net.Utility.Helper; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | | using Microsoft.Extensions.Hosting; |
| | | using NPOI.SS.Formula.Functions; |
| | | using SqlSugar; |
| | | |
| | | |
| | |
| | | var settingServices = container.ServiceProvider.GetService<ICoreCmsSettingServices>(); |
| | | var orderItemServices = container.ServiceProvider.GetService<ICoreCmsOrderItemServices>(); |
| | | var productsServices = container.ServiceProvider.GetService<ICoreCmsProductsServices>(); |
| | | var distributionServices = container.ServiceProvider.GetService<ICoreCmsDistributionServices>(); |
| | | var allConfigs = await settingServices.GetConfigDictionaries(); |
| | | //获取积分获取模式 |
| | | var pointGetModel = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.PointGetModel).ObjectToInt(); |
| | |
| | | var ordersRewardProportion = CommonHelper.GetConfigDictionary(allConfigs, SystemSettingConstVars.OrdersRewardProportion).ObjectToInt(); |
| | | if (ordersRewardProportion > 0) |
| | | { |
| | | var point = Convert.ToInt32(money / ordersRewardProportion); |
| | | await SetPoint(userId, point, (int)GlobalEnumVars.UserPointSourceTypes.PointTypeRebate, |
| | | "订单:" + orderId + " 奖励"); |
| | | //如果是经销商就不能获得积分 |
| | | var user = await distributionServices.QueryListByClauseAsync(x => x.userId == userId && x.verifyStatus == 1 && x.isDelete == false );//(int)GlobalEnumVars.DistributionVerifyStatus.VerifyYes |
| | | |
| | | if (user == null || user.Count == 0) |
| | | { |
| | | //如果是普通用户则货得积分 |
| | | var point = Convert.ToInt32(money / ordersRewardProportion); |
| | | await SetPoint(userId, point, (int)GlobalEnumVars.UserPointSourceTypes.PointTypeRebate, |
| | | "订单:" + orderId + " 奖励"); |
| | | } |
| | | } |
| | | } |
| | | else if (pointGetModel == 2) |