





















<?php /** * 公司与部门关联模型 */ class CompanyRelationModel extends RelationModel{ //主表名称 protected $tableName = 'company'; //定义关联关系 protected $_link = array( //关联表名称 'department' => array( 'mapping_type' => MANY_TO_MANY, //多对多关系 'foreign_key' => 'company_id', //主表外键 'relation_key' => 'department_id', //关联表外键 'relation_table' => 'sys_company_department', //中间表(员工对应角色表), 'mapping_fields' => 'id, name, pId' //关联表显示字段 ) ); } ?>
posted @ 2014-12-21 22:32 王翔(kingfly) 阅读(1566) 评论(0) 收藏 举报
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。