我如何获得今天到期日并将于明天结束的产品?
在此查询
$current_date = date('d/m/y/');
$future_date = strtotime($current_date, "+ 1 day");
$today_date = strtotime($current_date);
$sql = "SELECT distinct wposts.*
FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
WHERE wposts.ID = wpostmeta.post_id
AND wposts.post_status = 'publish'
AND wposts.post_type = 'products'
AND wpostmeta.meta_value =$today_date AND
wpostmeta.meta_value <=$future_date
ORDER BY wposts.post_date DESC";
wpostmeta.meta_value表中的值
1520380800, 07/03/18
数据库