WH01243 4 lat temu
rodzic
commit
a3a54063c0
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      services/userlib/userDocService.go

+ 3 - 3
services/userlib/userDocService.go

@@ -342,7 +342,7 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 			//兑换的
 			//兑换的
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=? ", in.UserId, model.UserDocStatus_Normal, in.AppId).Find(&data)
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=? ", in.UserId, model.UserDocStatus_Normal, in.AppId).Find(&data)
 			count = int64(len(data))
 			count = int64(len(data))
-			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=?  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isDownload=1 and isDelete=?  and  appId=? order by create_at desc  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
 			if err.Error != nil {
 			if err.Error != nil {
 				log.Println("查询兑换记录失败:", err)
 				log.Println("查询兑换记录失败:", err)
 				msg = "查询兑换记录失败"
 				msg = "查询兑换记录失败"
@@ -352,7 +352,7 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 			//收藏的
 			//收藏的
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1   and  appId=? ", in.UserId, model.UserDocStatus_Normal, in.AppId).Find(&data)
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1   and  appId=? ", in.UserId, model.UserDocStatus_Normal, in.AppId).Find(&data)
 			count = int64(len(data))
 			count = int64(len(data))
-			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1   and  appId=?  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and isCollection=1   and  appId=? order by create_at desc  limit ?,?", in.UserId, model.UserDocStatus_Normal, in.AppId, startIndex, in.PageSize).Find(&data)
 			if err.Error != nil {
 			if err.Error != nil {
 				log.Println("查询收藏记录失败:", err)
 				log.Println("查询收藏记录失败:", err)
 				msg = "查询收藏记录失败"
 				msg = "查询收藏记录失败"
@@ -362,7 +362,7 @@ func UserDocsList(in *userlib.UserDocsRequest) ([]*model.UserDoc, int64, bool, s
 			//回收站
 			//回收站
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and   isDelete=?  and  appId=? ", in.UserId, model.UserDocStatus_LogicDelete, in.AppId).Find(&data)
 			err := docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=? and   isDelete=?  and  appId=? ", in.UserId, model.UserDocStatus_LogicDelete, in.AppId).Find(&data)
 			count = int64(len(data))
 			count = int64(len(data))
-			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=?  and  isDelete=?  and  appId=?  limit ?,?", in.UserId, model.UserDocStatus_LogicDelete, in.AppId, startIndex, in.PageSize).Find(&data)
+			err = docRpcUtil.GetJyDocsDB().Table("user_doc").Where(" userId=?  and  isDelete=?  and  appId=?  order by create_at desc limit ?,?", in.UserId, model.UserDocStatus_LogicDelete, in.AppId, startIndex, in.PageSize).Find(&data)
 			if err.Error != nil {
 			if err.Error != nil {
 				log.Println("查询回收站记录失败:", err)
 				log.Println("查询回收站记录失败:", err)
 				msg = "查询回收站记录失败"
 				msg = "查询回收站记录失败"