| 1 | = Procedura zmiany daty lub godziny wydania gazety = |
| 2 | |
| 3 | Należy znaleźć: |
| 4 | |
| 5 | $regularIssueDate - normalna data zamknięcia wydania |
| 6 | $changeIssueDate - zmieniona data wydania |
| 7 | |
| 8 | 1. Ogłoszenia które normalnie wygasną przed 17:00, we wtorek - one nie powinny iść do tego poniedziałkowego wydania |
| 9 | select * from ads where enddate > '$changeIssueDate' and enddate < '$regularIssueDate ' and status = 1 and magazinepromotion > 0 |
| 10 | |
| 11 | Te ogłoszenia wyłączamy |
| 12 | |
| 13 | |
| 14 | 2. Ogłoszenia które normalnie wygasną przed 17:00 we wtorek ale mają przedłużenia - one powinny pójść |
| 15 | select * from orderitems i join orders o on o.id = i.orderid where productid in |
| 16 | ( |
| 17 | select id from ads where enddate > '$changeIssueDate' and enddate < '$regularIssueDate' and status = 1 |
| 18 | ) and i.startdate >= '$regularIssueDate' and i.magazinepromotion > 0 and o.status <> 4 |
| 19 | |
| 20 | Należy aktywować przedłużenia, a więc w OrderItems odpowiednio zmodyfikować start oraz end date i uruchomić na team city task activate. |
| 21 | |
| 22 | 3. Ogłoszenia, które nie są aktywne w poniedziałek, ale włączą się jeszcze przed 17:00 we wtorek. |
| 23 | select * from orderitems i join orders o on o.id = i.orderid |
| 24 | where o.status <> 4 and i.startdate >= '$changeIssueDate' and startdate < '$regularIssueDate' and subscriptionpromotion is null and i.magazinepromotion > 0 |
| 25 | |
| 26 | Należy aktywować ogłoszenia, a więc w OrderItems odpowiednio zmodyfikować start oraz end date i uruchomić na team city task activate. |