mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 23:30:35 -04:00
Pretty print SQL
This commit is contained in:
parent
31a8bc2d6c
commit
26a24cdbe2
17 changed files with 316 additions and 82 deletions
|
@ -19,7 +19,12 @@ class PollItem extends PropertiesBase{
|
|||
|
||||
protected function GetVoteCount(): int{
|
||||
if($this->_VoteCount === null){
|
||||
$this->_VoteCount = Db::QueryInt('SELECT count(*) from PollVotes pv inner join PollItems pi using (PollItemId) where pi.PollItemId = ?', [$this->PollItemId]);
|
||||
$this->_VoteCount = Db::QueryInt('
|
||||
SELECT count(*)
|
||||
from PollVotes pv
|
||||
inner join PollItems pi using (PollItemId)
|
||||
where pi.PollItemId = ?
|
||||
', [$this->PollItemId]);
|
||||
}
|
||||
|
||||
return $this->_VoteCount;
|
||||
|
@ -35,7 +40,11 @@ class PollItem extends PropertiesBase{
|
|||
throw new Exceptions\InvalidPollItemException();
|
||||
}
|
||||
|
||||
$result = Db::Query('SELECT * from PollItems where PollItemId = ?', [$pollItemId], 'PollItem');
|
||||
$result = Db::Query('
|
||||
SELECT *
|
||||
from PollItems
|
||||
where PollItemId = ?
|
||||
', [$pollItemId], 'PollItem');
|
||||
|
||||
if(sizeof($result) == 0){
|
||||
throw new Exceptions\InvalidPollItemException();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue