File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -529,8 +529,7 @@ type FindOrgOptions struct {
529
529
func queryUserOrgIDs (userID int64 ) * builder.Builder {
530
530
return builder .Select ("org_id" ).From ("org_user" ).
531
531
Where (builder.Eq {
532
- "uid" : userID ,
533
- "is_public" : true ,
532
+ "uid" : userID ,
534
533
})
535
534
}
536
535
@@ -559,7 +558,7 @@ func FindOrgs(opts FindOrgOptions) ([]*Organization, error) {
559
558
560
559
// CountOrgs returns total count organizations according options
561
560
func CountOrgs (opts FindOrgOptions ) (int64 , error ) {
562
- return db .GetEngine (db .DefaultContext ).Join ( "INNER" , "`org_user`" , "`org_user`.org_id=`user`.id" ).
561
+ return db .GetEngine (db .DefaultContext ).
563
562
Where (opts .toConds ()).
564
563
Count (new (User ))
565
564
}
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ func TestFindOrgs(t *testing.T) {
324
324
IncludePrivate : false ,
325
325
})
326
326
assert .NoError (t , err )
327
- assert .EqualValues (t , 0 , len (orgs ))
327
+ assert .EqualValues (t , 1 , len (orgs ))
328
328
329
329
total , err := CountOrgs (FindOrgOptions {
330
330
UserID : 4 ,
You can’t perform that action at this time.
0 commit comments