mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 18:11:52 -04:00
Pretty print SQL
This commit is contained in:
parent
31a8bc2d6c
commit
26a24cdbe2
17 changed files with 316 additions and 82 deletions
|
@ -46,12 +46,29 @@ if(sizeof($expiredPatrons) > 0){
|
|||
}
|
||||
|
||||
foreach($expiredPatrons as $patron){
|
||||
Db::Query('UPDATE Patrons set Ended = ? where UserId = ?', [$now, $patron->UserId]);
|
||||
Db::Query('UPDATE Benefits set CanAccessFeeds = false, CanVote = false, CanBulkDownload = false where UserId = ?', [$patron->UserId]);
|
||||
Db::Query('
|
||||
UPDATE Patrons
|
||||
set Ended = ?
|
||||
where UserId = ?
|
||||
', [$now, $patron->UserId]);
|
||||
|
||||
Db::Query('
|
||||
UPDATE Benefits
|
||||
set CanAccessFeeds = false,
|
||||
CanVote = false,
|
||||
CanBulkDownload = false
|
||||
where UserId = ?
|
||||
', [$patron->UserId]);
|
||||
|
||||
// Email the patron to notify them their term has ended
|
||||
// Is the patron a recurring subscriber?
|
||||
$lastPayment = Db::Query('SELECT * from Payments where UserId = ? order by Created desc limit 1;', [$patron->UserId], 'Payment');
|
||||
$lastPayment = Db::Query('
|
||||
SELECT *
|
||||
from Payments
|
||||
where UserId = ?
|
||||
order by Created desc
|
||||
limit 1
|
||||
', [$patron->UserId], 'Payment');
|
||||
|
||||
if(sizeof($lastPayment) > 0 && $patron->User->Email !== null){
|
||||
$em = new Email();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue