mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -04:00
Use shorthand assignment for basic getters
This commit is contained in:
parent
99b5fd66f2
commit
7f5ffb4aea
21 changed files with 142 additions and 326 deletions
|
@ -24,33 +24,30 @@ class DonationDrive{
|
|||
// *******
|
||||
|
||||
protected function GetDonationCount(): int{
|
||||
if(!isset($this->_DonationCount)){
|
||||
$this->_DonationCount = Db::QueryInt('
|
||||
SELECT sum(cnt)
|
||||
from
|
||||
return $this->_DonationCount ??= Db::QueryInt('
|
||||
SELECT sum(cnt)
|
||||
from
|
||||
(
|
||||
(
|
||||
# Anonymous patrons, i.e. from AOGF
|
||||
select count(*) cnt from Payments
|
||||
where
|
||||
UserId is null
|
||||
and
|
||||
(
|
||||
# Anonymous patrons, i.e. from AOGF
|
||||
select count(*) cnt from Payments
|
||||
where
|
||||
UserId is null
|
||||
and
|
||||
(
|
||||
(IsRecurring = true and Amount >= 10 and Created >= ?)
|
||||
or
|
||||
(IsRecurring = false and Amount >= 100 and Created >= ?)
|
||||
)
|
||||
(IsRecurring = true and Amount >= 10 and Created >= ?)
|
||||
or
|
||||
(IsRecurring = false and Amount >= 100 and Created >= ?)
|
||||
)
|
||||
union all
|
||||
(
|
||||
# All non-anonymous patrons
|
||||
select count(*) as cnt from Patrons
|
||||
where Created >= ?
|
||||
)
|
||||
) x
|
||||
', [$this->Start, $this->Start, $this->Start]);
|
||||
}
|
||||
return $this->_DonationCount;
|
||||
)
|
||||
union all
|
||||
(
|
||||
# All non-anonymous patrons
|
||||
select count(*) as cnt from Patrons
|
||||
where Created >= ?
|
||||
)
|
||||
) x
|
||||
', [$this->Start, $this->Start, $this->Start]);
|
||||
}
|
||||
|
||||
protected function GetTargetDonationCount(): int{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue