lihao 4 år sedan
förälder
incheckning
7966643ece

+ 2 - 2
gx_api/GxPress/Repository/GxPress.Repository.Implement/Collection/CollectionRepository.cs

@@ -120,7 +120,7 @@ namespace GxPress.Repository.Implement.Collection
                 if (!string.IsNullOrEmpty(request.SearchKey))
                     sql += $@"  AND(b.Title LIKE '%{request.SearchKey}%' OR a.FolderName LIKE '%{request.SearchKey}%')";
                 sql +=
-                    $@" ORDER BY a.AttributeValue desc,a.IsTop DESC, a.LastModifiedDate DESC,a.Sort desc";
+                    $@" ORDER BY a.AttributeValue desc,a.IsTop DESC,a.Sort,a.LastModifiedDate DESC desc";
                 if (request.Page > 0)
                     sql += $" LIMIT {(request.Page - 1) * request.PerPage},{request.PerPage}";
             }
@@ -141,7 +141,7 @@ namespace GxPress.Repository.Implement.Collection
                 }
                 else
                     sql += $" and a.ParentId={request.FolderId}";
-                sql += $@" ORDER BY  a.AttributeValue desc,a.IsTop DESC, a.LastModifiedDate DESC,a.Sort desc";
+                sql += $@" ORDER BY  a.AttributeValue desc,a.IsTop DESC,a.Sort DESC,a.LastModifiedDate desc";
                 if (request.Page > 0)
                     sql += $" LIMIT {(request.Page - 1) * request.PerPage},{request.PerPage}";
             }

+ 1 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/MiddleRepository.cs

@@ -186,7 +186,7 @@ namespace GxPress.Repository.Implement
             var sql = $"update tede_middle set IsTop={isTop},LastModifiedDate='{middle.CreatedDate.ToString()}' where id={id}";
             if (middle.IsTop == false)
             {
-                sql = $"update tede_middle set IsTop={isTop},LastModifiedDate=CreatedDate where id={id}";
+                sql = $"update tede_middle set IsTop={isTop},LastModifiedDate='{DateTime.Now.ToString()}' where id={id}";
                 return await connection.ExecuteAsync(sql) > 0;
             }
             return await connection.ExecuteAsync(sql) > 0;