fn
This commit is contained in:
parent
8719a89356
commit
d11611dce7
@ -24,6 +24,7 @@ CREATE OR REPLACE FUNCTION GET_TIMELINES(INT8[])
|
|||||||
)
|
)
|
||||||
AS
|
AS
|
||||||
$$
|
$$
|
||||||
|
<<fn>>
|
||||||
DECLARE
|
DECLARE
|
||||||
activate_cards JSONB := '{}';
|
activate_cards JSONB := '{}';
|
||||||
packages JSONB := '{}';
|
packages JSONB := '{}';
|
||||||
@ -74,7 +75,7 @@ BEGIN
|
|||||||
WHEN '0' THEN
|
WHEN '0' THEN
|
||||||
IF (activated_at < (order_row->>'created_at')::TIMESTAMP) THEN
|
IF (activated_at < (order_row->>'created_at')::TIMESTAMP) THEN
|
||||||
activated_at := (order_row->>'created_at')::TIMESTAMP;
|
activated_at := (order_row->>'created_at')::TIMESTAMP;
|
||||||
UPDATE vd.cards SET virtual_activated_at = activated_at WHERE cards.sim = (order_row->>'sim')::BIGINT;
|
UPDATE vd.cards SET virtual_activated_at = fn.activated_at WHERE cards.sim = (order_row->>'sim')::BIGINT;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
temp_service_start_at := TO_CHAR(activated_at, 'YYYY-MM-01 00:00:00');
|
temp_service_start_at := TO_CHAR(activated_at, 'YYYY-MM-01 00:00:00');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user