Zaktualizuj zapytania SQL w klasie Products, aby umożliwić wyszukiwanie po 'offer_id' z użyciem operatora LIKE oraz popraw lmtime i rozmiar pliku class.Products.php w pliku ftp-kr.sync.cache.json. Dodatkowo, popraw formatowanie 'offer_id' w metodzie cron.
This commit is contained in:
4
.vscode/ftp-kr.sync.cache.json
vendored
4
.vscode/ftp-kr.sync.cache.json
vendored
@@ -41,8 +41,8 @@
|
||||
},
|
||||
"class.Products.php": {
|
||||
"type": "-",
|
||||
"size": 9259,
|
||||
"lmtime": 1755698072124,
|
||||
"size": 9685,
|
||||
"lmtime": 1755764898292,
|
||||
"modified": false
|
||||
},
|
||||
"class.Site.php": {
|
||||
|
||||
@@ -336,7 +336,7 @@ class Cron
|
||||
$itemNode = $channelNode->appendChild($doc->createElement('item'));
|
||||
|
||||
$offer_id = $mdb -> get( 'products', 'offer_id', [ 'id' => $row['product_id'] ] );
|
||||
|
||||
$offer_id = str_replace( 'shopify_pl', 'shopify_PL', $offer_id );
|
||||
$p_gid = $itemNode->appendChild($doc->createElement('g:id', $offer_id));
|
||||
|
||||
foreach ($fieldMappings as $dbField => $xmlTag) {
|
||||
|
||||
@@ -37,7 +37,7 @@ class Products
|
||||
global $mdb;
|
||||
|
||||
if ( $search )
|
||||
return $mdb -> query( 'SELECT pt.*, p.offer_id, p.min_roas FROM products_temp AS pt INNER JOIN products AS p ON p.id = pt.product_id WHERE client_id = \'' . $client_id . '\' AND ( pt.name LIKE \'%' . $search . '%\' OR offer_id = ' . (int)$search . ' ) ORDER BY ' . $order_name . ' ' . $order_dir . ', id DESC LIMIT ' . $start . ', ' . $limit ) -> fetchAll();
|
||||
return $mdb -> query( 'SELECT pt.*, p.offer_id, p.min_roas FROM products_temp AS pt INNER JOIN products AS p ON p.id = pt.product_id WHERE client_id = \'' . $client_id . '\' AND ( pt.name LIKE \'%' . $search . '%\' OR offer_id LIKE \'%' . $search . '%\' ) ORDER BY ' . $order_name . ' ' . $order_dir . ', id DESC LIMIT ' . $start . ', ' . $limit ) -> fetchAll();
|
||||
else
|
||||
return $mdb -> query( 'SELECT pt.*, p.offer_id, p.min_roas FROM products_temp AS pt INNER JOIN products AS p ON p.id = pt.product_id WHERE client_id = \'' . $client_id . '\' ORDER BY ' . $order_name . ' ' . $order_dir . ', id DESC LIMIT ' . $start . ', ' . $limit ) -> fetchAll();
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class Products
|
||||
global $mdb;
|
||||
|
||||
if ( $search )
|
||||
return $mdb -> query( 'SELECT COUNT(0) FROM products_temp AS pt INNER JOIN products AS p ON p.id = pt.product_id WHERE client_id = \'' . $client_id . '\' AND ( pt.name LIKE \'%' . $search . '%\' OR offer_id = ' . (int)$search . ' )' ) -> fetchColumn();
|
||||
return $mdb -> query( 'SELECT COUNT(0) FROM products_temp AS pt INNER JOIN products AS p ON p.id = pt.product_id WHERE client_id = \'' . $client_id . '\' AND ( pt.name LIKE \'%' . $search . '%\' OR offer_id LIKE \'%' . $search . '%\' )' ) -> fetchColumn();
|
||||
else
|
||||
return $mdb -> query( 'SELECT COUNT(0) FROM products_temp AS pt INNER JOIN products AS p ON p.id = pt.product_id WHERE client_id = \'' . $client_id . '\'' ) -> fetchColumn();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user