updated plugin Easy Digital Downloads version 3.1.0.4

This commit is contained in:
2023-01-18 16:39:57 +00:00
committed by Gitium
parent ae8dabbd21
commit 6f8f73e860
77 changed files with 2262 additions and 681 deletions

View File

@ -187,6 +187,7 @@ class Download {
"SELECT SUM((oa.total - oa.tax)/ oa.rate) as revenue
FROM {$wpdb->edd_order_adjustments} oa
INNER JOIN {$wpdb->edd_order_items} oi ON(oi.id = oa.object_id)
INNER JOIN {$wpdb->edd_orders} o ON oi.order_id = o.id AND o.type = 'sale' {$order_status_sql}
WHERE {$product_id_sql}
{$price_id_sql}
AND oa.object_type = 'order_item'
@ -194,7 +195,9 @@ class Download {
AND oi.status IN('complete','partially_refunded')
{$date_query_sql}";
$results = $wpdb->get_row( "SELECT SUM(revenue) AS revenue FROM ({$order_items} UNION {$order_adjustments})a" );
$sql = "SELECT SUM(revenue) AS revenue FROM ({$order_items} UNION {$order_adjustments})a";
$results = $wpdb->get_row( $sql );
return ! empty( $results->revenue ) ? $results->revenue : 0.00;
}