Procházet zdrojové kódy

列表筛选调整
达标信息数据调整

DuGuYang před 1 rokem
rodič
revize
b3de0e875f

+ 10 - 7
Areas/Api/Controllers/v1/MainServer/MerchantInfoController.cs

@@ -143,15 +143,18 @@ namespace MySystem.Areas.Api.Controllers.v1
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             IQueryable<MerchantInfo> query = maindb.MerchantInfo.Where(m => m.UserId == UserId && (m.Status == 2 || m.QueryCount == 2));
             DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
-            int IsActNum = query.Count(m => m.IsAct == 1);
-            int UnActNum = query.Count(m => m.IsAct == 0);
             if (!string.IsNullOrEmpty(SearchKey))
             {
                 query = query.Where(m => m.Name.Contains(SearchKey));
             }
             if (Kind > 0)
             {
-                query = query.Where(m => m.BindStatus == Kind);
+                string subjectType = "";
+                if (Kind == 1) subjectType = "SUBJECT_TYPE_INDIVIDUAL";
+                if (Kind == 2) subjectType = "SUBJECT_TYPE_ENTERPRISE";
+                if (Kind == 3) subjectType = "SUBJECT_TYPE_SMALL";
+                List<int> ids = maindb.MerchantAddInfo.Where(m => m.SubjectType == subjectType).ToList().Select(m => m.Id).ToList();
+                query = query.Where(m => ids.Contains(m.Id));
             }
             if (ActiveStatus > 0)
             {
@@ -159,17 +162,17 @@ namespace MySystem.Areas.Api.Controllers.v1
                 query = query.Where(m => m.ActivationStatus == ActiveStatus);
             }
             int TotalCount = query.Count();
+            int IsActNum = query.Count(m => m.IsAct == 1);
+            int ProductCount = query.Count();
             if (IsAct > 0)
             {
-                IsActNum = query.Count(m => m.IsAct == 1);
-                UnActNum = query.Count(m => m.IsAct == 0);
                 if (IsAct == 2) IsAct = 0;
                 query = query.Where(m => m.IsAct == IsAct);
             }
             int ActCount = query.Count(m => m.ActivationDate == today);
-            int ProductCount = query.Count();
             int ProductActCount = query.Count(m => m.ActivationStatus == 1);
             int ProductUnActCount = ProductCount - ProductActCount;
+            int UnActNum = ProductCount - IsActNum;
             if (TradeSort == "1")
             {
                 if (DateSort == "1")
@@ -252,7 +255,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             Obj.Add("IsAct", merchant.IsAct); //是否激活(0 否 1 是)
             if (merchant.IsAct == 1)
             {
-                var orderInfo = maindb.MerchantDepositOrder.FirstOrDefault(m => m.Status == 1 && m.MerchantId == Id) ?? new MerchantDepositOrder();
+                var orderInfo = maindb.MerchantDepositOrder.FirstOrDefault(m => m.Status > 0 && m.MerchantId == Id) ?? new MerchantDepositOrder();
                 var IsPay = 0;
                 if (orderInfo.Id > 0)
                 {

+ 18 - 11
Util/MerchantAmountSummayUtil.cs

@@ -27,34 +27,41 @@ namespace MySystem
             {
                 var month = DateTime.Parse(query.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                 var TradeMonth = "";
+                var TradeTime = "";
                 decimal TradeAmount = 0.00M;
                 Dictionary<string, string> dic = new Dictionary<string, string>();
                 for (int i = 0; i < 10; i++)
                 {
                     TradeMonth = month.AddMonths(i + 1).ToString("yyyy-MM");
-                    var check = new MerchantAmountSummayService().QueryAmount("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "' and MerchantId=" + MerchantId + "");
+                    TradeTime = month.AddMonths(i + 1).ToString("yyyyMM");
+                    // TradeTime = (int.Parse("202308") + i + 1).ToString();
+                    var check = new MerchantAmountSummayService().QueryAmount("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeTime + "' and MerchantId=" + MerchantId + "");
                     if (check.Count > 0)
                     {
-                        dic = new MerchantAmountSummayService().Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "'");
+                        dic = new MerchantAmountSummayService().Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeTime + "'");
                         TradeAmount = decimal.Parse(dic["TradeAmount"].ToString());
                     }
+                    //待考核
+                    if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(TradeTime))
+                    // if (int.Parse("202309") < int.Parse(TradeTime))
+                    {
+                        Status = 0;
+                    }
                     else
                     {
                         //考核中
-                        if (DateTime.Now.ToString("yyyy-MM") == TradeMonth) Status = 1;
-                        //待考核
-                        if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(month.ToString("yyyyMM"))) Status = 0;
+                        if (DateTime.Now.ToString("yyyyMM") == TradeMonth) Status = 1;
                         //已通过
                         if (TradeAmount >= 10000 && check.Count > 0) Status = 2;
                         //未通过
                         if (TradeAmount < 10000 && check.Count > 0) Status = -1;
-
-                        Dictionary<string, object> curData = new Dictionary<string, object>();
-                        curData.Add("TradeMonth", TradeMonth); //月份
-                        curData.Add("TradeAmount", TradeAmount); //订单金额
-                        curData.Add("Status", Status); //状态(-1 未通过 0 待考核 1 考核中 2 已通过 3 未参与)
-                        dataList.Add(curData);
                     }
+
+                    Dictionary<string, object> curData = new Dictionary<string, object>();
+                    curData.Add("TradeMonth", TradeMonth); //月份
+                    curData.Add("TradeAmount", TradeAmount); //订单金额
+                    curData.Add("Status", Status); //状态(-1 未通过 0 待考核 1 考核中 2 已通过 3 未参与)
+                    dataList.Add(curData);
                 }
             }
             return dataList;