nguyenminh

wordpres query custom

    global $wpdb;
    $zipcargo = 1;
$post_ids = $wpdb->get_col( $wpdb->prepare(
    "select z.id from smp_address z where z.zone_receive=%s",
    $zipcargo
) );
   
   $yourArgs =array(
        'post_type' => 'shop_order',
       'driver_status' => 'minh',
       
       'post__in'  => $post_ids,
       'date_query' => array(
    array(
        'after' => '1980-01-01',
        'before' => '2038-01-01',
        'inclusive' => true,
    ),
),
        'meta_key' => '_order_total',
        'orderby'   => 'meta_value',
        'order' => 'DESC',
        'post_status' => array( 'wc-processing','wc-cancelled'),
        'posts_per_page' => 2,
        'paged' => 3,
       'meta_query' => array(
           'relation' => 'AND',
            array(
                'key' => '_billing_zip',
                'value' => 1,
                'compare' => '=',
               'type' => 'NUMERIC'
            )
           ,
            array(
                'key' => '_shipping_zip',
                'value' => '5',
                'compare' => '=',
               'type' => 'NUMERIC'
            )
       )
    
        );
   
   $customPosts = new WP_Query($yourArgs);
echo '<pre>';
var_dump($customPosts->request);
    echo 'dfdsfds';
}

Categorised in: Tổng hợp

0 Comments for "wordpres query custom"

Leave a Reply

Your email address will not be published. Required fields are marked *