Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/fsossa/AdopteUnDev into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
monelcocou committed Jan 10, 2025
2 parents dd73a04 + d9b8a8d commit 256cb7b
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
21 changes: 19 additions & 2 deletions web_app/src/Repository/DeveloperRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,25 @@ public function __construct(ManagerRegistry $registry)
// ->getOneOrNullResult()
// ;
// }
public function findLatestVisiteAndLike(int $limite): array {
public function findLatestVisiteAndLike(int $limite): array
{
return $this->createQueryBuilder('d')
->orderBy('d.id', 'DESC')
->setMaxResults($limite)
->getQuery()
->getResult();

return [];
}
public function findBest(int $limite): array
{
return $this->createQueryBuilder('poste')
->select('dev, COUNT(companyVisitDev.id) AS viewCount')
->join('companyVisitDev.developer', 'dev')
->groupBy('dev.id')
->orderBy('viewCount', 'DESC')
->setMaxResults($limite)
->getQuery()
->getResult();
}

}
27 changes: 19 additions & 8 deletions web_app/src/Repository/PosteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,25 @@ public function __construct(ManagerRegistry $registry)
// ->getOneOrNullResult()
// ;
// }

public function findBest(int $limite): array {

return [];

public function findBest(int $limite): array
{
return $this->createQueryBuilder('poste')
->select('poste', 'COUNT(developerVisitePostes.id) AS visites_count')
->join('poste.developerVisitePostes', 'developerVisitePostes')
->groupBy('poste.id')
->orderBy('COUNT(poste.id)', 'DESC')
->setMaxResults($limite)
->getQuery()
->getResult();
}

public function findLatest(int $limite): array {

return [];

public function findLatest(int $limite): array
{
return $this->createQueryBuilder('p')
->orderBy('p.id', 'DESC')
->setMaxResults($limite)
->getQuery()
->getResult();
}
}

0 comments on commit 256cb7b

Please sign in to comment.