日期:2014-05-17 浏览次数:20477 次
$sql = '
SELECT
`crm_order`.`oid`,
`crm_order`.`title`,
`crm_order`.`status`,
`crm_order`.`content`,
`crm_order`.`uid`,
`crm_order`.`createtime`,
`crm_order`.`orderstatus`,
`crm_order`.`department`,
`crm_order`.`type`,
`crm_ordertype`.`ot_name`,
`crm_user`.`name`,
`crm_order`.`name`,
`crm_department`.`crm_department`
FROM `crm_order`
LEFT JOIN `crm_ordertype` ON crm_order.type = crm_ordertype.ot_id
LEFT JOIN `crm_user` ON crm_user.uid = crm_order.uid
INNER JOIN `crm_department` ON crm_user.departmentid = crm_department.id ';
return $db->fetchAll($sql);
$sql = '
SELECT
`crm_order`.`oid`,
`crm_order`.`title`,
`crm_order`.`status`,
`crm_order`.`content`,
`crm_order`.`uid`,
`crm_order`.`createtime`,
`crm_order`.`orderstatus`,
`crm_order`.`department`,
`crm_order`.`type`,
`crm_ordertype`.`ot_name`,
`crm_user`.`name`,
`crm_order`.`name`,
`crm_department`.`part_name`