diff --git a/backend/marketing_engine/index.php b/backend/marketing_engine/index.php index 374f16f3..e381e924 100644 --- a/backend/marketing_engine/index.php +++ b/backend/marketing_engine/index.php @@ -27,10 +27,10 @@ try { switch ($action) { case 'get_task': $stmt = $con->prepare(" - SELECT id, type, target_url, content_text, media_url + SELECT id, type FROM marketing_tasks - WHERE status = 'pending' AND platform = ? AND (scheduled_at IS NULL OR scheduled_at <= NOW()) - ORDER BY created_at ASC LIMIT 1 + WHERE status = 'pending' AND platform = ? + ORDER BY id ASC LIMIT 1 "); $stmt->execute([$platform]); $task = $stmt->fetch(PDO::FETCH_ASSOC);