mirror of
https://github.com/owncloud/bookmarks.git
synced 2024-12-02 06:24:11 +01:00
Correct pg support for finding bookmark
This commit is contained in:
parent
de3d39f9bc
commit
15a515b92a
@ -62,11 +62,17 @@ class OC_Bookmarks_Bookmarks{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function findBookmarks($offset, $sqlSortColumn, $filter, $filterTagOnly){
|
public static function findBookmarks($offset, $sqlSortColumn, $filter, $filterTagOnly){
|
||||||
//$CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' );
|
$CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' );
|
||||||
$limit = 10;
|
$limit = 10;
|
||||||
$params=array(OCP\USER::getUser());
|
$params=array(OCP\USER::getUser());
|
||||||
//@TODO replace GROUP_CONCAT for postgresql
|
|
||||||
$sql = "SELECT *, (select GROUP_CONCAT(tag) from *PREFIX*bookmarks_tags where bookmark_id = b.id) as tags
|
if($CONFIG_DBTYPE == 'pgsql') {
|
||||||
|
$group_fct = 'array_agg(tag)';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$group_fct = 'GROUP_CONCAT(tag)';
|
||||||
|
}
|
||||||
|
$sql = "SELECT *, (select $group_fct from *PREFIX*bookmarks_tags where bookmark_id = b.id) as tags
|
||||||
FROM *PREFIX*bookmarks b
|
FROM *PREFIX*bookmarks b
|
||||||
WHERE user_id = ? ";
|
WHERE user_id = ? ";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user