Skip to content

Commit

Permalink
child view sql
Browse files Browse the repository at this point in the history
  • Loading branch information
nczirjak-acdh committed Aug 26, 2020
1 parent 0d91899 commit 601d654
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inst/dbfunctions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ LANGUAGE 'plpgsql';
*/
DROP FUNCTION gui.child_views_func(text, text, text, text, text, text, text[] );
CREATE FUNCTION gui.child_views_func(_parentid text, _limit text, _page text, _orderby text, _orderprop text, _lang text DEFAULT 'en', _rdftype text[] DEFAULT '{}' )
RETURNS table (id bigint, title text, avDate timestamp, description text, accesres text, titleimage text, acdhtype text)
RETURNS table (id bigint, title text, avDate timestamp, description text, accesres text, titleimage text, acdhtype text, orderid integer)
AS $func$
DECLARE _lang2 text := 'de';
/* we can just send string from the php so we need to cast the paging values to bigint */
Expand Down Expand Up @@ -345,7 +345,7 @@ DROP TABLE IF EXISTS child_ids;
alter table child_ids add orderid serial;

RETURN QUERY
select DISTINCT(ci.id), ci.title, CAST(ci.avdate as timestamp), ci.description, ci.accessres, ci.titleimage, ci.acdhtype
select DISTINCT(ci.id), ci.title, CAST(ci.avdate as timestamp), ci.description, ci.accessres, ci.titleimage, ci.acdhtype, ci.orderid
from child_ids as ci order by ci.orderid;
END
$func$
Expand Down

0 comments on commit 601d654

Please sign in to comment.