From c62ef98a2e6f24685b31c76d732cf21da221fe9e Mon Sep 17 00:00:00 2001 From: what Date: Fri, 21 Apr 2023 09:43:24 +0800 Subject: [PATCH] [feat] add NewOrmQueryWithRecursive helper --- helper/orm.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper/orm.go b/helper/orm.go index 3acce88..d00eb31 100644 --- a/helper/orm.go +++ b/helper/orm.go @@ -12,7 +12,7 @@ import ( // @param rResource 链接父模型 // @param rField 连接父模型字段, 如 xx_id // @param rForeignKey 关联外键, 如 id -type NewOrmRelationModel func(t contracts.RelationType, m contracts.Model, rResource, rField, rForeignKey string) contracts.Model +type NewOrmRelation func(t contracts.RelationType, m contracts.Model, rResource, rField, rForeignKey string) contracts.Model type NewOrmJoin func(t contracts.RelationType, res contracts.Resource, alias, rResource, rField, rForeignKey string) contracts.Join @@ -24,6 +24,8 @@ type NewOrmConditionFuncExpr func(rResource, rField, token string, operator cont type NewOrmConditionByRes func(items []base.ResCondition) contracts.Condition +type NewOrmQueryWithRecursive func(pField, cField string, root any, isWithoutCondition bool, depth int) contracts.QueryWithRecursive + type NewOrmQueryField func(rField base.ResField, t contracts.QueryDataType, alias string, options int) contracts.QueryField type NewOrmOrderBy func(sql string, direction contracts.OrderByDirection) contracts.OrderBy