From 3f91a6737fc06b45461ce11eae5660cbbf766f7e Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 29 十月 2024 16:20:02 +0800
Subject: [PATCH] 推广人员-》地推权限   创建时间-》注册时间

---
 CoreCms.Net.Services/User/CoreCmsUserPointLogServices.cs |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/CoreCms.Net.Services/User/CoreCmsUserPointLogServices.cs b/CoreCms.Net.Services/User/CoreCmsUserPointLogServices.cs
index 23218bd..dff1bc2 100644
--- a/CoreCms.Net.Services/User/CoreCmsUserPointLogServices.cs
+++ b/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)

--
Gitblit v1.9.1