Sfoglia il codice sorgente

同一个商户型创客绑定多台机具,取消某一台机具不会去掉商户型创客标记

DuGuYang 2 anni fa
parent
commit
c753d4fd4f

+ 6 - 1
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1186,7 +1186,6 @@ namespace MySystem.Areas.Admin.Controllers
                 pos.UserId = pos.BuyUserId;
                 merchant.UserId = pos.BuyUserId;
                 merchant.MerUserType = 0;
-                user.MerchantType = 0;
                 db.SetMerchantTypeRecord.Add(new SetMerchantTypeRecord()
                 {
                     CreateDate = DateTime.Now,
@@ -1207,6 +1206,12 @@ namespace MySystem.Areas.Admin.Controllers
                     BuyUserId = pos.BuyUserId,
                 });
                 db.SaveChanges();
+                var count = db.SetMerchantTypeRecord.Count(m => m.ToUserId == user.Id && m.OperateType == 1);
+                if (count == 0)
+                {
+                    user.MerchantType = 0;
+                    db.SaveChanges();
+                }
                 if (pos.BindMerchantId == 0)
                 {
                     pos.BindMerchantId = merchant.Id;