我收到数组到字符串转换的错误。这是我的控件
public function report()
{
$from=$this->input->post('from_date');
$to = $this->input->post('to_date');
$data['result']= $this->Account_model->get_report($from,$to)->result();
$data['total'] = $total= $this->Account_model->get_total_amount($from,$to)->result();
var_dump($total);
$this->load->view('report_payment_details',$data);
}
这是我的模特
public function get_total_amount($from,$to)
{
$this->db->join('payment','payment.order_id=services.id','left');
$this->db->select('services.id,sum(payment.actual_amount) as total_amount');
$this->db->join('customer','customer.id=services.customer_id');
$this->db->order_by('services.id','desc');
$this->db->where('date >=', $from);
$this->db->where('date <=', $to);
return $this->db->get('services');
这是我的观点
<td><?php echo $total; ?></td>
这里我想获得两个日期的总金额,但是得到数组到字符串转换的错误