Просмотр исходного кода

设置商户代理添加信息匹配限制

DuGuYang 2 лет назад
Родитель
Сommit
63e65e116d
1 измененных файлов с 35 добавлено и 2 удалено
  1. 35 2
      Areas/Admin/Controllers/MainServer/SysToolsController.cs

+ 35 - 2
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -1104,6 +1104,39 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "商户" + MerNo + "已经被设置";
             }
+            if (merchant != null)
+            {
+                //立刷
+                if (pos.BrandId == 6)
+                {
+                    if (user.CertId.Substring(0, 4) == merchant.MerIdcardNo.Substring(0, 4) && user.CertId.ToUpper().Substring(user.CertId.Length - 2, 2) == merchant.MerIdcardNo.ToUpper().Substring(merchant.MerIdcardNo.Length - 2, 2) && user.RealName.Substring(0, 1) == merchant.MerchantName.Substring(0, 1))
+                    {
+                        merchant.UserId = user.Id;
+                        merchant.MerUserType = 1;
+                    }
+                    else
+                    {
+                        return "设置商户型创客和机具对应商户信息不匹配,无法设置";
+                    }
+                }
+                //其他
+                else
+                {
+                    if (string.IsNullOrEmpty(merchant.MerIdcardNo) || string.IsNullOrEmpty(merchant.MerchantName))
+                    {
+                        return "该商户资料未完善,请联系在线客服补全资料后重试";
+                    }
+                    if (user.CertId.Substring(0, 6) == merchant.MerIdcardNo.Substring(0, 6) && user.CertId.ToUpper().Substring(user.CertId.Length - 4, 4) == merchant.MerIdcardNo.ToUpper().Substring(merchant.MerIdcardNo.Length - 4, 4) && merchant.MerchantName.Contains(user.RealName))
+                    {
+                        merchant.UserId = user.Id;
+                        merchant.MerUserType = 1;
+                    }
+                    else
+                    {
+                        return "设置商户型创客和机具对应商户信息不匹配,无法设置";
+                    }
+                }
+            }
             pos.SeoTitle = user.Id.ToString();
             pos.UserId = user.Id;
             if (pos.BindMerchantId == 0)
@@ -1122,8 +1155,8 @@ namespace MySystem.Areas.Admin.Controllers
                 }
             }
             user.MerchantType = 1;
-            merchant.UserId = user.Id;
-            merchant.MerUserType = 1;
+            // merchant.UserId = user.Id;
+            // merchant.MerUserType = 1;
             db.SetMerchantTypeRecord.Add(new SetMerchantTypeRecord()
             {
                 CreateDate = DateTime.Now,