我有一个项目要做组织架构管理,一般组织架构是 id,pid,name,charge.
我现在想显示出来 系统ID,部门名,上级部门名字,主管名
假如有2个表 org, user表,
我需要得到如下的结果: select a.id,a.name,b.name as pname,c.username
from org a ,org b,user c where a.pid=b.id and a.charge=c.userid.
请问用thinkphp的怎么得到一个array list?
能提供关联模型分页,或者原生sql,或者join()方式都可以。