WC_Tracker::get_order_dates()
Get last order date.
Метод класса: WC_Tracker{}
Хуков нет.
Возвращает
Строку
.
Использование
$result = WC_Tracker::get_order_dates();
Код WC_Tracker::get_order_dates() WC Tracker::get order dates WC 7.3.0
private static function get_order_dates() { global $wpdb; $min_max = $wpdb->get_row( " SELECT MIN( post_date_gmt ) as 'first', MAX( post_date_gmt ) as 'last' FROM {$wpdb->prefix}posts WHERE post_type = 'shop_order' AND post_status = 'wc-completed' ", ARRAY_A ); if ( is_null( $min_max ) ) { $min_max = array( 'first' => '-', 'last' => '-', ); } $processing_min_max = $wpdb->get_row( " SELECT MIN( post_date_gmt ) as 'processing_first', MAX( post_date_gmt ) as 'processing_last' FROM {$wpdb->prefix}posts WHERE post_type = 'shop_order' AND post_status = 'wc-processing' ", ARRAY_A ); if ( is_null( $processing_min_max ) ) { $processing_min_max = array( 'processing_first' => '-', 'processing_last' => '-', ); } return array_merge( $min_max, $processing_min_max ); }