From 2d90b05cf8c377ab592fe2f1786d3b1f8657a94c Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 22 May 2023 14:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E4=BC=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/pkg/models/relation/posts.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/pkg/models/relation/posts.go b/app/pkg/models/relation/posts.go index 07c5ad0..0b5cfa6 100644 --- a/app/pkg/models/relation/posts.go +++ b/app/pkg/models/relation/posts.go @@ -5,7 +5,7 @@ import ( "github.com/fthvgb1/wp-go/model" ) -var hasUser = model.RelationHasOne(func(m *models.Posts) uint64 { +var PostsWithAuthor = model.RelationHasOne(func(m *models.Posts) uint64 { return m.PostAuthor }, func(p *models.Users) uint64 { return p.Id @@ -17,7 +17,3 @@ var hasUser = model.RelationHasOne(func(m *models.Posts) uint64 { ForeignKey: "ID", Local: "post_author", }) - -func PostsWithAuthor() (func(any) []any, func(any, any), any, any, model.Relationship) { - return hasUser() -}