mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-04 10:24:07 +02:00
add ability to filter before/after id
This commit is contained in:
parent
c7c8c21322
commit
d3d2b59e83
2 changed files with 16 additions and 0 deletions
|
|
@ -124,6 +124,14 @@ class DemoListProvider extends BaseProvider {
|
|||
$query->andWhere($query->expr()->gt('created_at',
|
||||
$query->createNamedParameter($where['after']->format(\DATE_ATOM))));
|
||||
}
|
||||
if (isset($where['before_id'])) {
|
||||
$query->andWhere($query->expr()->lt('id',
|
||||
$query->createNamedParameter($where['before_id'], PDO::PARAM_INT)));
|
||||
}
|
||||
if (isset($where['after_id'])) {
|
||||
$query->andWhere($query->expr()->gt('id',
|
||||
$query->createNamedParameter($where['after_id'], PDO::PARAM_INT)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue