feat: Enhance user settings with cron URL plan display

- Added a new field to display the cron URL plan in user settings.
- Updated JavaScript to handle the new plan data.

refactor: Unify product model and migrate data

- Migrated product data from `products_data` to `products` table.
- Added new columns to `products` for better data organization.
- Created `products_aggregate` table for storing aggregated product metrics.

chore: Drop deprecated products_data table

- Removed `products_data` table as data is now stored in `products`.

feat: Add merchant URL flags to products

- Introduced flags for tracking merchant URL status in `products` table.
- Normalized product URLs to handle empty or invalid values.

feat: Link campaign alerts to specific products

- Added `product_id` column to `campaign_alerts` table for better tracking.
- Created an index for efficient querying of alerts by product.

chore: Add debug scripts for client data inspection

- Created debug scripts to inspect client data from local and remote databases.
- Included error handling and output formatting for better readability.
This commit is contained in:
2026-02-20 17:50:14 +01:00
parent 0024a25bfb
commit 167ced3573
31 changed files with 5697 additions and 1227 deletions

View File

@@ -0,0 +1,20 @@
<?php
require 'config.php';
require 'libraries/medoo/medoo.php';
$mdb = new medoo([
'database_type' => 'mysql',
'database_name' => $database['name'],
'server' => $database['remote_host'],
'username' => $database['user'],
'password' => $database['password'],
'charset' => 'utf8'
]);
$cols = $mdb->query("SHOW COLUMNS FROM clients")->fetchAll(PDO::FETCH_ASSOC);
echo "COLUMNS:" . PHP_EOL;
foreach ($cols as $c) { echo $c['Field'] . PHP_EOL; }
$rows = $mdb->query("SELECT id, name, COALESCE(active,0) AS active, CONCAT('[', COALESCE(google_ads_customer_id,''), ']') AS google_ads_customer_id FROM clients ORDER BY id ASC")->fetchAll(PDO::FETCH_ASSOC);
echo "ROWS=" . count($rows) . PHP_EOL;
foreach ($rows as $r) { echo json_encode($r, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) . PHP_EOL; }
$eligible = $mdb->query("SELECT id, name FROM clients WHERE COALESCE(active,0)=1 AND TRIM(COALESCE(google_ads_customer_id,''))<>'' ORDER BY id ASC")->fetchAll(PDO::FETCH_ASSOC);
echo "ELIGIBLE=" . json_encode($eligible, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) . PHP_EOL;
?>