模型使用MySQL视图,某些字段不在同一级别/层次结构中

I've configured a model to use a view. When querying this view in my controller, the recordset returned has two fields that are not at the same level/hiearchy than the rest.

In this case, see ast (asset_id and asset_configuration_id).

Querying the view manually in dbForge, I get a flat recordset. I cannot figure out why this is happening.

Model:

<?php
App::uses('AppModel', 'Model');

class AssetConfigurationDeploymentStatus extends AppModel {
    public $useTable = "asset_configuration_deployment_statuses";

}
?>

Query for view asset_configuration_deployment_statuses:

SELECT `ac`.`id` AS `asset_configuration_id`
     , `ast`.`id` AS `asset_id`
     , `ac`.`domain_id` AS `domain_id`
     , `ac`.`server_id` AS `server_id`
     , `e`.`acronym` AS `environment`
     , `e`.`id` AS `environment_id`
     , `d`.`name` AS `domain`
     , `lds`.`deployed_by` AS `last_deployed_by`
     , `lds`.`deployed_date` AS `last_deployed_date`
     , `lds`.`revision` AS `last_deployed_revision`
     , `lds`.`is_failed` AS `last_deployed_is_failed`
     , `lss`.`deployed_by` AS `last_successful_deployed_by`
     , `lss`.`deployed_date` AS `last_successful_deployed_date`
     , `lss`.`revision` AS `last_successful_deployed_revision`
     , `lss`.`is_failed` AS `last_successful_deployed_is_failed`
     , `eds`.`count_failed_deployments` AS `count_failed_deployments`
     , `er`.`last_successful_environment_revision` AS `last_successful_environment_revision`
     , `ast`.`asset_group_id` AS `asset_group_id`
FROM
  (((((((((`assets` `ast`
JOIN `asset_configurations` `ac`
ON ((`ast`.`id` = `ac`.`asset_id`)))
JOIN `last_deployment_statuses` `lds`
ON ((`ac`.`id` = `lds`.`asset_configuration_id`)))
JOIN `last_successful_deployment_statuses` `lss`
ON ((`ac`.`id` = `lss`.`asset_configuration_id`)))
JOIN `last_environment_deployment_statuses` `eds`
ON ((`ac`.`id` = `eds`.`asset_configuration_id`)))
JOIN `domains` `d`
ON ((`ac`.`domain_id` = `d`.`id`)))
JOIN `servers` `s`
ON ((`ac`.`server_id` = `s`.`id`)))
JOIN `environments_servers` `es`
ON ((`s`.`id` = `es`.`server_id`)))
JOIN `environments` `e`
ON ((`es`.`environment_id` = `e`.`id`)))
JOIN `last_successful_environment_deployment_revision` `er`
ON (((`ac`.`asset_id` = `er`.`asset_id`) AND (`e`.`id` = `er`.`environment_id`))))

Controller code:

...

$this->loadModel("AssetConfigurationDeploymentStatus");
$all_deploy_items = $this->AssetConfigurationDeploymentStatus->find('all', array(
        'order'=>array('AssetConfigurationDeploymentStatus.environment_id','AssetConfigurationDeploymentStatus.domain'), 
        'conditions' => array('AssetConfigurationDeploymentStatus.asset_id' => $id)
    )
);

foreach($all_deploy_items as $conf){

    var_dump($conf);
    exit;
    ...
}

...

Output of dump:

array (size=2)
  'AssetConfigurationDeploymentStatus' => 
    array (size=16)
      'asset_configuration_id' => string '172' (length=3)
      'domain_id' => string '21' (length=2)
      'server_id' => string '10' (length=2)
      'environment' => string 'DEV' (length=3)
      'environment_id' => string '4' (length=1)
      'domain' => string 'my.domain.here' (length=28)
      'last_deployed_by' => string 'user' (length=7)
      'last_deployed_date' => string '2014-06-23 12:05:24' (length=19)
      'last_deployed_revision' => string '644' (length=3)
      'last_deployed_is_failed' => boolean false
      'last_successful_deployed_by' => string 'user' (length=7)
      'last_successful_deployed_date' => string '2014-06-23 12:05:24' (length=19)
      'last_successful_deployed_revision' => string '644' (length=3)
      'last_successful_deployed_is_failed' => boolean false
      'count_failed_deployments' => string '0' (length=1)
      'last_successful_environment_revision' => string '1930' (length=4)
  'ast' => 
    array (size=2)
      'asset_id' => string '47' (length=2)
      'asset_group_id' => string '28' (length=2)