移动系统liao
2025-02-17 557c2711a3e103ebc3d0492344eca9730d5e92b2
CoreCms.Net.Services/User/CoreCmsUserPointLogServices.cs
@@ -23,6 +23,7 @@
using CoreCms.Net.Utility.Helper;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using NPOI.SS.Formula.Functions;
using SqlSugar;
@@ -109,6 +110,7 @@
                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();
@@ -118,9 +120,16 @@
                    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)