Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-server
Commits
8c2793dd
Commit
8c2793dd
authored
May 14, 2019
by
François Agneray
Browse files
#23
=> done
parent
4a81a602
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Action/Search/SearchDataAction.php
View file @
8c2793dd
...
...
@@ -114,15 +114,6 @@ final class SearchDataAction
)
->
withStatus
(
404
);
}
$queryParams
=
$request
->
getQueryParams
();
if
(
!
array_key_exists
(
'c'
,
$queryParams
))
{
return
$this
->
dispatchHttpError
(
$response
,
'Invalid request'
,
'Param c is required for this request'
)
->
withStatus
(
400
);
}
$queryParams
=
$request
->
getQueryParams
();
if
(
!
array_key_exists
(
'a'
,
$queryParams
))
{
return
$this
->
dispatchHttpError
(
...
...
@@ -138,9 +129,11 @@ final class SearchDataAction
$queryBuilder
=
$connection
->
createQueryBuilder
();
$anisQueryBuilder
=
$this
->
aqbf
->
create
(
$queryBuilder
,
$dataset
);
$anisQueryBuilder
->
select
(
explode
(
';'
,
$queryParams
[
'a'
]))
->
where
(
explode
(
';'
,
$queryParams
[
'c'
]));
$anisQueryBuilder
->
select
(
explode
(
';'
,
$queryParams
[
'a'
]));
if
(
array_key_exists
(
'c'
,
$queryParams
))
{
$anisQueryBuilder
->
where
(
explode
(
';'
,
$queryParams
[
'c'
]));
}
if
(
array_key_exists
(
'o'
,
$queryParams
))
{
$anisQueryBuilder
->
order
(
explode
(
';'
,
$queryParams
[
'o'
]));
...
...
src/Action/Search/SearchMetaAction.php
View file @
8c2793dd
...
...
@@ -114,16 +114,7 @@ final class SearchMetaAction
'Dataset with id '
.
$args
[
'dname'
]
.
' is not found'
)
->
withStatus
(
404
);
}
$queryParams
=
$request
->
getQueryParams
();
if
(
!
array_key_exists
(
'c'
,
$queryParams
))
{
return
$this
->
dispatchHttpError
(
$response
,
'Invalid request'
,
'Param c is required for this request'
)
->
withStatus
(
400
);
}
$queryParams
=
$request
->
getQueryParams
();
if
(
!
array_key_exists
(
'a'
,
$queryParams
))
{
return
$this
->
dispatchHttpError
(
...
...
@@ -149,9 +140,11 @@ final class SearchMetaAction
$queryBuilder
=
$connection
->
createQueryBuilder
();
$anisQueryBuilder
=
$this
->
aqbf
->
create
(
$queryBuilder
,
$dataset
);
$anisQueryBuilder
->
count
()
->
where
(
explode
(
';'
,
$queryParams
[
'c'
]));
$anisQueryBuilder
->
count
();
if
(
array_key_exists
(
'c'
,
$queryParams
))
{
$anisQueryBuilder
->
where
(
explode
(
';'
,
$queryParams
[
'c'
]));
}
$this
->
logger
->
info
(
'SQL: '
.
$anisQueryBuilder
->
getSQL
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment