This commit is contained in:
2026-04-12 01:35:19 +02:00
parent 91a8b85f38
commit d04e02020c
70 changed files with 8634 additions and 207 deletions

View File

@@ -65,7 +65,7 @@ if ($statuses === []) {
exit(1);
}
$ordersRows = $pdo->query('SELECT id, external_status_id FROM orders ORDER BY id ASC')->fetchAll(PDO::FETCH_ASSOC);
$ordersRows = $pdo->query('SELECT id, status_code FROM orders ORDER BY id ASC')->fetchAll(PDO::FETCH_ASSOC);
if (!is_array($ordersRows) || $ordersRows === []) {
echo '[result] Brak zamowien do aktualizacji.' . PHP_EOL;
exit(0);
@@ -73,7 +73,7 @@ if (!is_array($ordersRows) || $ordersRows === []) {
$preview = [];
$changes = 0;
$updateStmt = $pdo->prepare('UPDATE orders SET external_status_id = :status, is_canceled_by_buyer = :is_canceled_by_buyer, updated_at = NOW() WHERE id = :id');
$updateStmt = $pdo->prepare('UPDATE orders SET status_code = :status, is_canceled_by_buyer = :is_canceled_by_buyer, updated_at = NOW() WHERE id = :id');
if (!$dryRun) {
$pdo->beginTransaction();
@@ -85,7 +85,7 @@ try {
if ($id <= 0) {
continue;
}
$old = strtolower(trim((string) ($row['external_status_id'] ?? '')));
$old = strtolower(trim((string) ($row['status_code'] ?? '')));
$new = $statuses[array_rand($statuses)];
if (count($preview) < 8) {