update
This commit is contained in:
@@ -163,12 +163,12 @@ class SupplementalFeed
|
||||
$labels_updated = self::refresh_bestseller_labels_for_client( $client_id );
|
||||
|
||||
$products = $mdb -> query(
|
||||
"SELECT p.offer_id, p.title, p.description, p.google_product_category, p.custom_label_3, p.custom_label_4
|
||||
"SELECT p.offer_id, p.title, p.description, p.google_product_category, p.custom_label_1, p.custom_label_3, p.custom_label_4
|
||||
FROM products p
|
||||
WHERE p.client_id = :client_id
|
||||
AND p.offer_id IS NOT NULL
|
||||
AND p.offer_id <> ''
|
||||
AND ( p.title IS NOT NULL OR p.description IS NOT NULL OR p.google_product_category IS NOT NULL OR p.custom_label_3 IS NOT NULL OR p.custom_label_4 IS NOT NULL )",
|
||||
AND ( p.title IS NOT NULL OR p.description IS NOT NULL OR p.google_product_category IS NOT NULL OR p.custom_label_1 IS NOT NULL OR p.custom_label_3 IS NOT NULL OR p.custom_label_4 IS NOT NULL )",
|
||||
[ ':client_id' => $client_id ]
|
||||
) -> fetchAll( \PDO::FETCH_ASSOC );
|
||||
|
||||
@@ -187,7 +187,7 @@ class SupplementalFeed
|
||||
throw new \RuntimeException( 'Nie mozna otworzyc pliku: ' . $file_path );
|
||||
}
|
||||
|
||||
fwrite( $fp, "id\ttitle\tdescription\tgoogle_product_category\tcustom_label_3\tcustom_label_4\n" );
|
||||
fwrite( $fp, "id\ttitle\tdescription\tgoogle_product_category\tcustom_label_1\tcustom_label_3\tcustom_label_4\n" );
|
||||
|
||||
$written = 0;
|
||||
foreach ( $products as $row )
|
||||
@@ -196,10 +196,11 @@ class SupplementalFeed
|
||||
$title = self::sanitize_for_tsv( $row['title'] ?? '' );
|
||||
$description = self::sanitize_for_tsv( $row['description'] ?? '' );
|
||||
$category = trim( (string) ( $row['google_product_category'] ?? '' ) );
|
||||
$custom_label_1 = trim( (string) ( $row['custom_label_1'] ?? '' ) );
|
||||
$custom_label_3 = trim( (string) ( $row['custom_label_3'] ?? '' ) );
|
||||
$custom_label_4 = trim( (string) ( $row['custom_label_4'] ?? '' ) );
|
||||
|
||||
if ( $offer_id === '' || ( $title === '' && $description === '' && $category === '' && $custom_label_3 === '' && $custom_label_4 === '' ) )
|
||||
if ( $offer_id === '' || ( $title === '' && $description === '' && $category === '' && $custom_label_1 === '' && $custom_label_3 === '' && $custom_label_4 === '' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -209,6 +210,7 @@ class SupplementalFeed
|
||||
$title,
|
||||
$description,
|
||||
$category,
|
||||
$custom_label_1,
|
||||
$custom_label_3,
|
||||
$custom_label_4
|
||||
] ) . "\n" );
|
||||
|
||||
Reference in New Issue
Block a user