1 回答
TA贡献1797条经验 获得超6个赞
虽然我不知道这些字段是如何存储在数据库中的,但这可能会为您指明正确的方向comp_closing。closing_time
$today = date('Y-m-d');
$time = date('H:i:s');
$compCount = array(
'post_type' => 'product',
'posts_per_page' => -1,
'meta_query' => array(
'relation' => 'OR',
// make sure the date is after the current date...
array(
'key' => 'comp_closing',
'compare' => '>',
'value' => $today,
),
// ...or if the date is the same...
array(
'relation' => 'AND',
array(
'key' => 'comp_closing',
'compare' => '=',
'value' => $today,
),
// ...make sure we didn’t hit the time yet.
array(
'key' => 'closing_time',
'compare' => '>',
'value' => $time,
)
)
),
'orderby' => 'meta_value_num',
'order' => 'ASC',
);
- 1 回答
- 0 关注
- 154 浏览
添加回答
举报
