李昊 4 years ago
parent
commit
ec0357a5f6

+ 5 - 0
gx_api/GxPress/Model/GxPress.Request/Media/MediaRequest.cs

@@ -187,6 +187,11 @@ namespace GxPress.Request.Media
         /// </summary>
         /// <value></value>
         public int LibraryType { get; set; }
+        /// <summary>
+        /// 搜索字段
+        /// </summary>
+        /// <value></value>
+        public string KeyWord { get; set; }
 
     }
 }

+ 2 - 0
gx_api/GxPress/Repository/GxPress.Repository.Implement/Media/MediaRepository.cs

@@ -155,6 +155,8 @@ namespace GxPress.Repository.Implement.Media
         {
             var result = new PagedList<Entity.tede2.Media.Media>();
             var query = Q.NewQuery();
+            if(!string.IsNullOrEmpty(request.KeyWord))
+               query.WhereLike(nameof(Entity.tede2.Media.Media.Title),$"%{request.KeyWord}%");
             if (request.IsDelete > 0)
                 query.Where(nameof(Entity.tede2.Media.Media.IsDelete), request.IsDelete);
             if (request.MediaType > 0)