Browse Source

修改激活、未激活数

DuGuYang 1 năm trước cách đây
mục cha
commit
46a277cc83

+ 3 - 3
Areas/Api/Controllers/v1/MainServer/MerchantInfoController.cs

@@ -143,6 +143,8 @@ 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));
@@ -158,6 +160,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             }
             if (IsAct > 0)
             {
+                if (IsAct == 2) IsAct = 0;
                 query = query.Where(m => m.IsAct == IsAct);
             }
             int TotalCount = query.Count();
@@ -165,9 +168,6 @@ namespace MySystem.Areas.Api.Controllers.v1
             int ProductCount = query.Count();
             int ProductActCount = query.Count(m => m.ActivationStatus == 1);
             int ProductUnActCount = ProductCount - ProductActCount;
-
-            int IsActNum = query.Count(m => m.IsAct == 1);
-            int UnActNum = ProductCount - IsActNum;
             if (TradeSort == "1")
             {
                 if (DateSort == "1")