Mon Dec 16
Reminder of JSON fields
$table->json('source_payload');
$table->string('order_id')->storedAs('source_payload->>"$.eCommerceOrderId"');
$table->string('user_id')->storedAs('source_payload->>"$.eCommerceCustomerId"');
$table->string('organization_id')->storedAs('source_payload->>"$.obrorgid"');
// See https://themsaid.com/laravel-mysql-json-colum-fast-lookup-20160709/
$table->index('order_id');
$table->index('user_id');
$table->index('organization_id');
SELECT
*, payload->>"$[0].eCommerceCustomerId" as `eCommerceCustomerId`
FROM
pendingOrderStatus
WHERE
payload->>"$[0].eCommerceCustomerId" = '16350';