$total_customers_top_order = array(); $customers_top_order = $data->topStatisticsOrder(); $total_customers_top_order['data'] = array('total' => $customers_top_order['total'], 'percent' => $customers_top_order['percent'], 'sign' => $customers_top_order['sign']); $total_customers_top_order['status'] = 200; echo Tools::jsonEncode($total_customers_top_order); break; case 'TOTAL_TOP_VISIT': $total_customers_top_visit = array(); $customers_top_visit = $data->getVisitTop(); $total_customers_top_visit['data'] = array('total' => $customers_top_visit['total'], 'percent' => $customers_top_visit['percent'], 'sign' => $customers_top_visit['sign']); $total_customers_top_visit['status'] = 200; echo Tools::jsonEncode($total_customers_top_visit); break; case 'TOTAL_TOP_PROFIT': $total_customers_top_profit = array(); $customers_top_profit = $data->getProfitTop(); $total_customers_top_profit['data'] = array('total' => $customers_top_profit['total'], 'percent' => $customers_top_profit['percent'], 'sign' => $customers_top_profit['sign']); $total_customers_top_profit['status'] = 200; echo Tools::jsonEncode($total_customers_top_profit); break; case 'TOTAL_TOP_REVENUE': $total_revenue = array(); $revenue = $data->getRevenueTop(); $total_revenue['data'] = array('total' => $revenue['total'], 'percent' => $revenue['percent'], 'sign' => $revenue['sign']); $total_revenue['status'] = 200; echo Tools::jsonEncode($total_revenue); break; case 'TOTAL_TOP_PRODUCT': $total_product = array(); $product = $data->getProductTop(); $total_product['data'] = array('total' => $product['total']);