如何在codeigniter中为用户创建分层树结构?

For eg. Admin creates a user 'A' then A is the child user of admin, then if 'A' creates a user 'B' then 'B' is the child user of A.

use ion_auth library is very complete secure, and use groups structure...

I am not sure what this has to do with CodeIgniter, but a normal solution is to have an additional column that is labelled something like 'parent_id' and contains the id of the parent. In that way you can run a query to get all the children of a parent, then all the grand-children of those children etc etc using the parent ID in the lookup. Since this is heavily dependent on your actual usage, set up, and is quite extensive involving views, controllers, css, models (perhaps) and table design, it is not really possible to give you example CI code.

What have you done so far, what code have you got, can you narrow down your problem to a single aspect, like creating a tree view, or identifying child and grandchild of an element, or writing a query to collect the data etc. The more focus your question has the better we can help you.