This commit is contained in:
Almira Krdzic
2018-10-21 02:40:58 +02:00
parent bfc216b0fe
commit 4ee63b053c
3 changed files with 28 additions and 2 deletions

View File

@@ -93,7 +93,29 @@ class Wiass_REST_Delivery_Process_API {
);
}
return rest_ensure_response($data);
global $wpdb;
$data = array();
$total = 0;
$queries =$wpdb->queries;
foreach ($queries as $query) {
$data[] = array(
$query[0],
$query[1]
);
$total += $query[1];
}
global $wp_timer;
return rest_ensure_response(array(
'data' => $queries,
'total' => $total * 1000,
'start' => (microtime() - $wp_timer) * 1000
));
}
public static function get_customer_acceptance(WP_REST_Request $request){