Fix wrong code issue (#1247)

This commit is contained in:
FrancescoUK
2017-04-22 09:30:53 +01:00
parent 08a7bd9606
commit dd21f205b7
2 changed files with 3 additions and 16 deletions

View File

@@ -829,21 +829,8 @@ class Sales extends Secure_Controller
{
$cust_stats = $this->Customer->get_stats($customer_id);
$data['customer_total'] = empty($cust_stats) ? 0 : $cust_stats->total;
// retrieve the info from Mailchimp only if there is an email address assigned
if(!empty($customer_info->email))
{
$this->load->library('mailchimp_lib');
$list_id = $this->encryption->decrypt($this->config->item('mailchimp_list_id'));
// collect mailchimp customer info
if(($mailchimp_info = $this->mailchimp_lib->getMemberInfo($list_id, $customer_info->email)) !== FALSE)
{
$data['mailchimp_info'] = $this->xss_clean($mailchimp_info);
}
}
}
$data['customer_info'] = implode("\n", array(
$data['customer'],
$data['customer_address'],

View File

@@ -89,9 +89,9 @@ class Customer extends Person
}
/*
Gets total about a particular customer
Gets stats about a particular customer
*/
public function get_totals($customer_id)
public function get_stats($customer_id)
{
$this->db->select('SUM(payment_amount) AS total');
$this->db->from('sales');