mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
adding parameter until and since on 'work near end'
This commit is contained in:
parent
20a4950c60
commit
c08bd76e4b
@ -48,8 +48,10 @@ class AccompanyingCourseWorkApiController extends ApiController
|
||||
*/
|
||||
public function myWorksNearEndDate(Request $request): JsonResponse
|
||||
{
|
||||
$since = (new \DateTimeImmutable('now'))->sub(new \DateInterval('P15D'));
|
||||
$until = (new \DateTimeImmutable('now'))->add(new \DateInterval('P15D'));
|
||||
$since = (new \DateTimeImmutable('now'))
|
||||
->sub(new \DateInterval('P'.$request->query->getInt('since', 15).'D'));
|
||||
$until = (new \DateTimeImmutable('now'))
|
||||
->add(new \DateInterval('P'.$request->query->getInt('since', 15).'D'));
|
||||
$total = $this->accompanyingPeriodWorkRepository
|
||||
->countNearEndDateByUser($this->getUser(), $since, $until);
|
||||
$paginator = $this->getPaginatorFactory()->create($total);
|
||||
|
Loading…
x
Reference in New Issue
Block a user