Drupal 6视图 - 左连接问题

时间:2009-06-08 17:58:45

标签: drupal drupal-views

我遇到了Drupal 6 Views和我自己的模块的问题。我试图让查询使用两个左连接,但它拒绝识别后两者。这不是订单问题,因为我来回切换它们。

有人能看到这个问题吗?如果有的话?

<?php


function mc_bhg_views_data() {

    $data['mc_bhg_status_ref'] = array(
        'table' => array(
            'group' => 'BHG Loan',
            'title' => 'mc_bhg_status_ref',
            'join' => array(
                'node' => array(
                    'left_field' => 'nid',
                    'field' => 'nid',        
                ),
            ),
        ),
    );
    $data['mc_bhg_status_names'] = array(
        'table' => array(
            'group' => 'BHG Loan',
            'title' => 'mc_bhg_status_names',
            'join' => array(
                'mc_bhg_status_refs' => array(
                    'left_field' => 'status',
                    'field' => 'id',
                ),
            ),
        ),
    );
    $data['mc_bhg_status_ref']['status'] = array(
        'title' => t('Status ID'),
        'help' => t('Relate Loan Status ID'),
        'field' => array(
            'handler' => 'views_handler_field',
            'click sortable' => TRUE,
        ),
        'filter' => array(
            'handler' => 'views_handler_filter_numeric',
        ),
    );
    $data['mc_bhg_status_names']['name'] = array(
        'title' => t('Status Name'),
        'help' => t('Relate the Loan Status Name'),
        'field' => array(
            'handler' => 'views_handler_field',
            'click sortable' => TRUE,
        ),
    );
    return $data;  
}

1 个答案:

答案 0 :(得分:1)

我不确定这是Drupal 5还是6 - 我猜五。

这是你的问题吗?

    $data['mc_bhg_status_names'] = array(
    'table' => array(
            'group' => 'BHG Loan',
            'title' => 'mc_bhg_status_names',
            'join' => array(
                    'mc_bhg_status_refs' => array(
                            'left_field' => 'status',
                            'field' => 'id',
                    ),
            ),
    ),
);

你说你正在加入'mc_bhg_status_refs' - 最后用's',但在第一个声明中你将它称为'mc_bhg_status_ref'。