多表组合的视图模型

浏览:1373 发布日期:2013/08/07 分类:求助交流 关键字: 视图模型
大家好, 最近在写一个资产管理系统, 但是关于thinkphp的多表视图模型还是有点不太清楚.

比如这条语句,

===================================================================
SELECT c.serial as Serial_Number,c.otherserial as FA_Number,c.os_license_id as Buy_Date,l.completename as Location,d.name as Section,m.name as Model,t.name as PC_Type,u.name as GID,u.firstname as FirstName,u.realname as LastName,s.name as Status
from (((((glpi_computers as c left join glpi_dropdown_domain as d on c.domain=d.id) left join glpi_dropdown_model as m on c.model=m.id) left join glpi_dropdown_state as s on c.state=s.id) left join
glpi_type_computers as t on c.type=t.id) left join glpi_users as u on c.FK_users=u.id) left join glpi_dropdown_locations as l on c.location=l.id

=====================================================================

在SQL查询中是正常的, 返回我想要的电脑结果.

但如果我在视图模型中定义的话, 无从下手, 官方手册只写了两个表之间的left join , 请高手指点一下.

最佳答案
评论( 相关
后面还有条评论,点击查看>>