From e1fc968fb296de92d2d090548039f6fc938aaece Mon Sep 17 00:00:00 2001 From: what Date: Mon, 25 Dec 2023 15:22:49 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=81=BF=E5=85=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=BF=87=E6=BB=A4=E4=B8=AD=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/resource.go b/base/resource.go index e91b1fe..ee4e8ea 100644 --- a/base/resource.go +++ b/base/resource.go @@ -230,7 +230,7 @@ func (this Resource) WithRolesCondition(b *db.Builder, t string, u contracts.Use items := do.MustInvoke[GetResRoles](this.container)(this.GetUuid(), u.Roles()...) subTables := lo.Reduce(items, func(carry string, item ResRole, _ int) string { - db := this.GetDBBuilder().Table(string(this.GetTable()), this.GetCode()).Select(db.Raw("`" + this.GetCode() + "`.*")) + db := this.GetDBBuilder().Table(string(this.GetTable()), this.GetCode()).Select(db.Raw("distinct `" + this.GetCode() + "`.*")) joins := lo.Filter(GetResRelations(item.Uuid), func(item ResRelation, _ int) bool { return item.Type == "inner" || item.Type == "left" || item.Type == "right"