mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
best diff on dashboard
This commit is contained in:
@@ -45,6 +45,14 @@ export class ClientService {
|
||||
return await this.clientRepository.count();
|
||||
}
|
||||
|
||||
public async getBestDiff(address: string) {
|
||||
const res = await this.clientRepository.createQueryBuilder('client')
|
||||
.select('MAX(client.bestDifficulty)', 'bestDifficulty')
|
||||
.where('client.address = :address', { address })
|
||||
.withDeleted()
|
||||
.getRawOne();
|
||||
return res?.bestDifficulty;
|
||||
}
|
||||
public async getByAddress(address: string): Promise<ClientEntity[]> {
|
||||
return await this.clientRepository.find({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user