Activerecord Codeigniter JOIN var_dump()显示奇怪的输出

Activerecord Codeigniter JOIN var_dump()显示奇怪的输出,activerecord,join,codeigniter-2,Activerecord,Join,Codeigniter 2,我正在尝试连接两个表客户和贷款。所以我的模型是: if($type == 'society'): $this->db->select('customers.customer_id,customers.customer_name,customers.customer_address,loan.loan_amount,loan.grant_date'); $this->db->from('customers'); $this-&

我正在尝试连接两个表
客户
贷款
。所以我的模型是:

if($type == 'society'):
        $this->db->select('customers.customer_id,customers.customer_name,customers.customer_address,loan.loan_amount,loan.grant_date');
        $this->db->from('customers');
        $this->db->join('loan','loan.customer_id = customers.customer_id');
        $this->db->where('loan.customer_type',$type);
        $result = $this->db->get();
        endif;

        return $result;
以及控制器:

$loan_customers_society = $this->loan_transaction_model->show_all_loan_customers($type = 'society');
var_dump($loan_customers_society);
但输出如下所示:

object(CI_DB_mysql_result)[19]
  public 'conn_id' => resource(36, mysql link persistent)
  public 'result_id' => resource(40, mysql result)
  public 'result_array' => 
    array
      empty
  public 'result_object' => 
    array
      empty
  public 'custom_result_object' => 
    array
      empty
  public 'current_row' => int 0
  public 'num_rows' => int 3
  public 'row_data' => null
这个输出是用来做什么的?如何获得所需的结果?

CI ActiveRecord
get()
方法不返回查询结果,而是生成查询并返回CI结果对象

为了获得结果,您需要使用
result()
result\u array()
方法:

有关详细信息,请参阅《CI用户指南》。

CI ActiveRecord
get()
方法不返回查询结果,而是生成查询并返回CI结果对象

为了获得结果,您需要使用
result()
result\u array()
方法:

有关更多信息,请参阅《CI用户指南》

$query  = $this->db->get();
$result = $query->result_array();

// var_dump($result);