Advertisement
phpface

Get today total sales

Dec 28th, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.27 KB | None | 0 0
  1. SELECT sum(pm1.meta_value) as total FROM `wp_postmeta` as pm1
  2.  
  3. INNER JOIN `wp_posts` as p ON p.ID = pm1.post_id
  4.  
  5. where pm1.meta_key = '_order_total'
  6.  
  7. and p.post_type = 'shop_order'
  8.  
  9. and p.post_status IN ( 'wc-completed', 'wc-processing' )
  10.  
  11. and p.post_date = '2018-12-28'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement