Prechádzať zdrojové kódy

修复音响绑定和已绑定列表

lcl 1 rok pred
rodič
commit
a72b99d840

+ 1 - 1
Areas/Api/Controllers/Main/MerchantInfoController.cs

@@ -481,7 +481,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data.getItem("PageSize").ToString()));
             int PageNum = int.Parse(function.CheckInt(data.getItem("PageNum").ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            IQueryable<Models.Main1.MachineForQrCode> query = main1db.MachineForQrCode.Where(m => m.MerchantId == MerchantId && m.MachineSnNo != m.SnNo && !string.IsNullOrEmpty(m.MachineSnNo)).OrderByDescending(m => m.MerchantId);
+            IQueryable<Models.Main1.MachineForQrCode> query = main1db.MachineForQrCode.Where(m => m.MerchantId == MerchantId && m.DataId.EndsWith("_2") && m.MachineSnNo != m.SnNo && !string.IsNullOrEmpty(m.MachineSnNo)).OrderByDescending(m => m.MerchantId);
             TotalCount = query.Count();
             if (PageNum == 1)
             {

+ 1 - 4
Areas/Api/Controllers/Main/MerchantQrCodeController.cs

@@ -118,7 +118,6 @@ namespace MySystem.Areas.Api.Controllers.v1
             Models.Main1.PosMachines machines = PosMachinesService.Query(" PosSn='" + SnNo + "'");
             Models.Main.MerchantInfo merchant = MerchantInfoService.Query(MerchantId);
             int PosId = 0;
-            int Kind = 0;
             if (SnNo == MachineNo || string.IsNullOrEmpty(MachineNo))
             {
                 if (pos.Id == 0)
@@ -130,7 +129,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                 //     return new AppResultJson() { Status = "-1", Info = "码牌未授权" };
                 // }
                 PosId = pos.Id;
-                Kind = 1;
             }
             else if (SnNo != MachineNo)
             {
@@ -143,7 +141,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                 //     return new AppResultJson() { Status = "-1", Info = "音响未授权" };
                 // }
                 PosId = machines.Id;
-                Kind = 2;
             }
             if (query.Id > 0)
             {
@@ -162,7 +159,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             }
             else
             {
-                string DataId = PosId + "_" + Kind;
+                string DataId = PosId + "_2";
                 Models.Main1.MachineForQrCode forQrCode = main1db.MachineForQrCode.FirstOrDefault(m => m.DataId == DataId);
                 if (forQrCode == null)
                 {

+ 1 - 1
Areas/Api/Controllers/Main/PosMachinesController.cs

@@ -548,7 +548,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             {
                 PageSize = 100000;
             }
-            IQueryable<PosMachines> query = main1db.PosMachines.Where(m => m.Status > -1 && m.BuyUserId == UserId && m.BindingState == 1);
+            IQueryable<PosMachines> query = main1db.PosMachines.Where(m => m.Status > -1 && m.BuyUserId == UserId && m.BindingState == 1 && m.DeviceKind == "2");
             if (!string.IsNullOrEmpty(SnNo))
             {
                 query = query.Where(m => m.PosSn == SnNo);