Plugin Directory

Changeset 1743991


Ignore:
Timestamp:
10/10/2017 02:48:46 PM (8 years ago)
Author:
devlucasmendes
Message:

Fix, getting right table names

Location:
fastdee/trunk/includes/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fastdee/trunk/includes/core/class-fd-ofertas.php

    r1730613 r1743991  
    392392            mt_offer_id.meta_value as _fd_offer_fastdee_id
    393393        FROM $wpdb->posts 
    394         LEFT JOIN $wpdb->postmeta AS mt_offer_id ON ( wp_posts.ID = mt_offer_id.post_id ) 
     394        LEFT JOIN $wpdb->postmeta AS mt_offer_id ON ( $wpdb->posts.ID = mt_offer_id.post_id ) 
    395395        WHERE $wpdb->posts.post_type = 'product'
    396396        AND (
    397         wp_posts.post_status = 'publish'
    398         OR wp_posts.post_status = 'future'
    399         OR wp_posts.post_status = 'draft'
    400         OR wp_posts.post_status = 'pending'
    401         OR wp_posts.post_status = 'private'
     397        $wpdb->posts.post_status = 'publish'
     398        OR $wpdb->posts.post_status = 'future'
     399        OR $wpdb->posts.post_status = 'draft'
     400        OR $wpdb->posts.post_status = 'pending'
     401        OR $wpdb->posts.post_status = 'private'
    402402        )
    403403        AND mt_offer_id.post_id IS NOT NULL
  • fastdee/trunk/includes/core/class-fd-update.php

    r1730613 r1743991  
    3030
    3131    /** Busca total de ofertas do fastdee no bd
     32     *
    3233     * @param bool $afterVersion2_4
     34     *
    3335     * @return string|int
    3436     */
     
    103105        $offersUpdated = $offset; //reset qtd atualizado
    104106
     107        global $wpdb;
     108
    105109        // busca só os que tem tem fd_id (antigos <v2.4 ficarao sem)
    106110        $queryString = "
    107111                SELECT
    108                     wp_posts.ID as post_id,
     112                    $wpdb->posts.ID as post_id,
    109113                    mt_offer_id.meta_value as _fd_offer_fastdee_id
    110                 FROM wp_posts 
    111                 LEFT JOIN wp_postmeta AS mt_offer_id ON ( wp_posts.ID = mt_offer_id.post_id ) 
    112                 WHERE wp_posts.post_type = 'product'
     114                FROM $wpdb->posts 
     115                LEFT JOIN $wpdb->postmeta AS mt_offer_id ON ( $wpdb->posts.ID = mt_offer_id.post_id ) 
     116                WHERE $wpdb->posts.post_type = 'product'
    113117                AND (
    114                     wp_posts.post_status = 'publish'
    115                     OR wp_posts.post_status = 'future'
    116                     OR wp_posts.post_status = 'draft'
    117                     OR wp_posts.post_status = 'pending'
    118                     OR wp_posts.post_status = 'private'
     118                    $wpdb->posts.post_status = 'publish'
     119                    OR $wpdb->posts.post_status = 'future'
     120                    OR $wpdb->posts.post_status = 'draft'
     121                    OR $wpdb->posts.post_status = 'pending'
     122                    OR $wpdb->posts.post_status = 'private'
    119123                )
    120124                AND mt_offer_id.post_id IS NOT NULL
     
    123127                OFFSET $offset";
    124128
    125         global $wpdb;
    126129        $products = $wpdb->get_results( $queryString, OBJECT );
    127130
Note: See TracChangeset for help on using the changeset viewer.