Skip to content

Commit

Permalink
Fix for slow select on admin main page load
Browse files Browse the repository at this point in the history
  • Loading branch information
abantecart committed Jan 14, 2016
1 parent 5a56e8c commit 1f4ffd4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public_html/admin/controller/pages/index/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function main() {
'start' => 0,
'limit' => 10
);
$top_customers = $this->model_sale_customer->getCustomers($filter);
$top_customers = $this->model_sale_customer->getCustomers($filter, 'quick');
foreach( $top_customers as $indx => $customer) {
$action = array();
$action[] = array(
Expand Down
2 changes: 1 addition & 1 deletion public_html/admin/controller/responses/common/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function latest_customers() {
'start' => 0,
'limit' => 10
);
$top_customers = $this->model_sale_customer->getCustomers($filter);
$top_customers = $this->model_sale_customer->getCustomers($filter, 'quick');
foreach( $top_customers as $indx => $customer) {
$top_customers[$indx]['url'] = $this->html->getSecureURL('sale/customer/update', '&customer_id='.$customer['customer_id']);
}
Expand Down
4 changes: 2 additions & 2 deletions public_html/admin/model/sale/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function getCustomers($data = array(), $mode = 'default') {
cg.name AS customer_group
";
}
if ( $mode != 'total_only'){
if ( $mode != 'total_only' && $mode != 'quick'){
$sql .= ", COUNT(o.order_id) as orders_count ";
}

Expand All @@ -353,7 +353,7 @@ public function getCustomers($data = array(), $mode = 'default') {

$sql .= " FROM " . $this->db->table("customers") . " c
LEFT JOIN " . $this->db->table("customer_groups") . " cg ON (c.customer_group_id = cg.customer_group_id) ";
if ( $mode != 'total_only'){
if ( $mode != 'total_only' && $mode != 'quick'){
$sql .= " LEFT JOIN " . $this->db->table("orders") . " o ON (c.customer_id = o.customer_id AND o.order_status_id>0) ";
}

Expand Down
2 changes: 1 addition & 1 deletion public_html/core/lib/layout_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ public function savePage($data, $page_id = 0){
SET parent_page_id = '" . ( int )$data ['parent_page_id'] . "',
controller = '" . $this->db->escape($data ['controller']) . "',
key_param = '" . $this->db->escape($data ['key_param']) . "',
key_param = '" . $this->db->escape($data ['key_value']) . "',
key_value = '" . $this->db->escape($data ['key_value']) . "',
date_modified = NOW()
WHERE page_id = '" . ( int )$page_id . "'");

Expand Down

0 comments on commit 1f4ffd4

Please sign in to comment.