update
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user