소스 검색

调整商户名称为模糊匹配

DuGuYang 2 년 전
부모
커밋
a97ba08184

+ 2 - 2
Areas/Api/Controllers/v1/Main1/ConsumerOrdersController.cs

@@ -48,7 +48,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             string condition = "";
             if (!string.IsNullOrEmpty(data["MerchantName"].ToString()))
             {
-                var merAddInfo = MerchantAddInfoService.Query(" and CertMerchantName='" + MerchantName + "'");
+                var merAddInfo = MerchantAddInfoService.Query(" and CertMerchantName like '%" + MerchantName + "%'");
                 condition += " and MerchantId='" + merAddInfo.Id + "'";
             }
             if (!string.IsNullOrEmpty(data["MakerCode"].ToString()))
@@ -125,7 +125,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
 
 
 
-        #region 交易查询-直连订单发起分
+        #region 交易查询-直连订单发起分
         [Authorize]
         public JsonResult DirectQueryDivideAccounts(string value)
         {

+ 6 - 4
Areas/Api/Controllers/v1/Main1/MerchantAddInfoController.cs

@@ -55,7 +55,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             }
             if (!string.IsNullOrEmpty(data["CertMerchantName"].ToString()))
             {
-                condition += " and CertMerchantName='" + CertMerchantName + "'";
+                condition += " and CertMerchantName like '%" + CertMerchantName + "%'";
             }
             if (!string.IsNullOrEmpty(data["ServicePhone"].ToString()))
             {
@@ -211,7 +211,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             condition = " and Id in (" + merIds + ")";
             if (!string.IsNullOrEmpty(MerchantName))
             {
-                condition += " and CertMerchantName='" + MerchantName + "'";
+                condition += " and CertMerchantName like '%" + MerchantName + "%'";
             }
             if (!string.IsNullOrEmpty(Mobile))
             {
@@ -288,7 +288,9 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             string AliPayToken = data["AliPayToken"].ToString(); //支付宝token
             string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
             Dictionary<string, object> Obj = new Dictionary<string, object>();
-            var query = MerchantAddInfoService.Query(int.Parse(MerchantId));
+            // var query = MerchantAddInfoService.Query(int.Parse(MerchantId));
+            var Id = int.Parse(MerchantId);
+            var query = main1db.MerchantAddInfo.FirstOrDefault(m => m.Id == Id) ?? new MerchantAddInfo();
             Dictionary<string, object> fields = new Dictionary<string, object>();
             if (query.Id > 0)
             {
@@ -308,8 +310,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                     query.SubMchid = WeChatNo;
                 }
             }
+            main1db.SaveChanges();
             // AppResultJson resultJson = MerchantAddInfoService.Edit(fields, int.Parse(MerchantId), false);
-
             return new AppResultJson() { Status = "1", Info = "添加成功", Data = Obj };
         }
         #endregion

+ 1 - 1
Areas/Api/Controllers/v1/Main1/MerchantInfoController.cs

@@ -43,7 +43,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             string condition = " and IsAct=1 and ExamineStatus=1 and Months=10";
             if (!string.IsNullOrEmpty(MerchantName))
             {
-                condition += " and Name='" + MerchantName + "'";
+                condition += " and Name like '%" + MerchantName + "%'";
             }
             if (!string.IsNullOrEmpty(AliPID))
             {

+ 2 - 2
Areas/Api/Controllers/v1/Main2/ConsumerOrdersController.cs

@@ -48,7 +48,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             string condition = "";
             if (!string.IsNullOrEmpty(data["MerchantName"].ToString()))
             {
-                var merAddInfo = MerchantAddInfoService.Query(" and CertMerchantName='" + MerchantName + "'");
+                var merAddInfo = MerchantAddInfoService.Query(" and CertMerchantName like '%" + MerchantName + "%'");
                 condition += " and MerchantId='" + merAddInfo.Id + "'";
             }
             if (!string.IsNullOrEmpty(data["MakerCode"].ToString()))
@@ -126,7 +126,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         #endregion
 
 
-        #region 交易查询-银联订单发起分
+        #region 交易查询-银联订单发起分
         [Authorize]
         public JsonResult UnionPayQueryDivideAccounts(string value)
         {

+ 2 - 2
Areas/Api/Controllers/v1/Main2/MerchantAddInfoController.cs

@@ -57,7 +57,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             }
             if (!string.IsNullOrEmpty(data["CertMerchantName"].ToString()))
             {
-                condition += " and CertMerchantName='" + CertMerchantName + "'";
+                condition += " and CertMerchantName like '%" + CertMerchantName + "%'";
             }
             if (!string.IsNullOrEmpty(data["ServicePhone"].ToString()))
             {
@@ -231,7 +231,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             condition = " and Id in (" + merIds + ")";
             if (!string.IsNullOrEmpty(MerchantName))
             {
-                condition += " and CertMerchantName='" + MerchantName + "'";
+                condition += " and CertMerchantName like '%" + MerchantName + "%'";
             }
             if (!string.IsNullOrEmpty(Mobile))
             {

+ 1 - 1
Areas/Api/Controllers/v1/Main2/MerchantInfoController.cs

@@ -42,7 +42,7 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             string condition = " and IsAct=1 and ExamineStatus=1 and Months=10";
             if (!string.IsNullOrEmpty(MerchantName))
             {
-                condition += " and Name='" + MerchantName + "'";
+                condition += " and Name like '%" + MerchantName + "%'";
             }
             if (!string.IsNullOrEmpty(MctNo))
             {