Parcourir la source

开户行查询接口地区参数支持多个

lcl il y a 1 an
Parent
commit
31ef385db4
1 fichiers modifiés avec 25 ajouts et 1 suppressions
  1. 25 1
      Areas/Api/Controllers/v1/MainServer/OpenBankTableController.cs

+ 25 - 1
Areas/Api/Controllers/v1/MainServer/OpenBankTableController.cs

@@ -45,7 +45,31 @@ namespace MySystem.Areas.Api.Controllers.v1
                 if(!string.IsNullOrEmpty(data["Areas"].ToString()))
                 {
                     string Areas = data["Areas"].ToString();
-                    query = query.Where(m => m.BankName.Contains(Areas));
+                    if(Areas.Contains(","))
+                    {
+                        string[] AreasList = Areas.Split(',');
+                        if(AreasList.Length == 3)
+                        {
+                            string p = AreasList[0];
+                            string c = AreasList[1];
+                            string a = AreasList[2];
+                            query = query.Where(m => (m.BankName.Contains(p) || m.BankName.Contains(c) || m.BankName.Contains(a)));
+                        }
+                        else if(AreasList.Length == 2)
+                        {
+                            string p = AreasList[0];
+                            string c = AreasList[1];
+                            query = query.Where(m => (m.BankName.Contains(p) || m.BankName.Contains(c)));
+                        }
+                        else
+                        {
+                            query = query.Where(m => m.BankName.Contains(Areas));
+                        }
+                    }
+                    else
+                    {
+                        query = query.Where(m => m.BankName.Contains(Areas));
+                    }
                 }
             }
             if(value.Contains("\"BankName\""))