                             SELECT U0."id"
                             FROM "locations_sqllocation" U0
                             WHERE U0."id" = ANY(user_location_ids_array)
-                            ORDER BY U0."tree_id" ASC, U0."lft" ASC
-                        )
-                    )
-                    ORDER BY "locations_sqllocation"."tree_id" ASC, "locations_sqllocation"."lft" ASC
+                        )
+                    )
                 )
             )
 

                            U0."id" = ANY(user_location_ids_array)
                            AND U1."expand_to_id" IS NOT NULL
                        )
                        ORDER BY U0."tree_id" ASC, U0."lft" ASC
                    )
                )


                            U0."id" = ANY(user_location_ids_array)
                            AND U1."include_without_expanding_id" IS NOT NULL
                        )
                    )
                )
            )
