作者 tangxvhui

调整AllParentUser sql

@@ -70,7 +70,7 @@ recursive t_user as ( @@ -70,7 +70,7 @@ recursive t_user as (
70 ) 70 )
71 union 71 union
72 ( 72 (
73 - select "child_user".id,"child_user".parent_id,"child_user".account,"child_user".name, 73 + select "parent_user".id,"parent_user".parent_id,"parent_user".account,"parent_user".name,
74 "child_user"."level" + 1 as "level" 74 "child_user"."level" + 1 as "level"
75 from "user" as "parent_user" 75 from "user" as "parent_user"
76 join t_user as "child_user" on "parent_user".id="child_user".parent_id 76 join t_user as "child_user" on "parent_user".id="child_user".parent_id
@@ -80,5 +80,5 @@ recursive t_user as ( @@ -80,5 +80,5 @@ recursive t_user as (
80 result := []UserData1{} 80 result := []UserData1{}
81 tx := d.transactionContext.PgTx 81 tx := d.transactionContext.PgTx
82 _, err := tx.Query(&result, sqlStr, userId) 82 _, err := tx.Query(&result, sqlStr, userId)
83 - return nil, err 83 + return result, err
84 } 84 }