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

根据条件查询自定义查询列表,标题模糊查询

lcl 2 лет назад
Родитель
Сommit
6e6aee4f81
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      Areas/Admin/Controllers/MainServer/CustomQueryController.cs

+ 4 - 4
Areas/Admin/Controllers/MainServer/CustomQueryController.cs

@@ -58,15 +58,15 @@ namespace MySystem.Areas.Admin.Controllers
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
 
-            Fields.Add("Title", "1"); //标题
-
-
             string condition = " and Status>-1";
             if(SysUserName != "admin")
             {
                 condition += " and CONCAT(',', AdminNames,',') like '%," + SysUserName + ",%'";
             }
-
+            if(!string.IsNullOrEmpty(data.Title))
+            {
+                condition += " and Title like '%" + data.Title + "%'";
+            }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("CustomQuery", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;