BY : seq-id
Sequential ID : 314
SELECT wp.`order_item_name` AS OName, w2.`meta_value` AS LineTotal, m1.`meta_value` AS Currency, m2.`meta_value` AS OrderInfo, po.`post_type` AS OType, po.`post_status` AS Status, DATE_FORMAT(po.`post_modified`,'%Y-%m-%d') AS LastChange, m3.`meta_value` AS SEQID, wp.`order_id` AS OrderID, re.`ID` AS Refund FROM `wp_woocommerce_order_items` wp JOIN `wp_posts` po ON (po.`ID` = wp.`order_id`) LEFT JOIN `wp_posts` re ON (re.`post_parent` = wp.`order_id` AND re.`post_type` = 'shop_order_refund') JOIN `wp_woocommerce_order_itemmeta` w1 ON (w1.`order_item_id` = wp.`order_item_id` AND w1.`meta_key` = '_product_id') JOIN `wp_woocommerce_order_itemmeta` w2 ON (w2.`order_item_id` = wp.`order_item_id` AND w2.`meta_key` = '_line_total') JOIN `wp_postmeta` m1 ON (wp.`order_id` = m1.`post_id` AND m1.`meta_key` = '_order_currency') LEFT JOIN `wp_postmeta` m2 ON (wp.`order_id` = m2.`post_id` AND m2.`meta_key` = 'wmc_order_info') LEFT JOIN `wp_postmeta` m3 ON (wp.`order_id` = m3.`post_id` AND m3.`meta_key` = '_billing_seq_member_id') JOIN `wp_term_relationships` wr ON (wr.`object_id` = w1.`meta_value`) JOIN `wp_terms` t1 ON (t1.`term_id` = wr.`term_taxonomy_id`) WHERE wp.`order_item_type` = 'line_item' AND t1.`slug` = 'membership' AND DATE_FORMAT(po.`post_modified`,'%Y') = YEAR(CURDATE()) AND po.`post_type` = 'shop_order' AND m3.`meta_value` = 314 ORDER BY wp.`order_id`, po.`post_modified` ASC LIMIT 1000
Cell 1
Cell 2
Cell 3
Cell 4
Cell 5
Cell 6

test tc_memberfee

------
UNPAID0

© 2020 Association for Digital Document Standards e.V. | Privacy Policy | Imprint