Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mouday committed Jul 1, 2023
1 parent 8300860 commit f6d63a8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions domain_admin/service/notify_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ def notify_user_about_cert_expired(notify_row: NotifyModel):

notify_expire_time = now + timedelta(days=notify_row.expire_days)

# 注意null的情况
rows = DomainModel.select().where(
DomainModel.user_id == notify_row.user_id,
DomainModel.is_monitor == True,
DomainModel.expire_time <= notify_expire_time
).where(
(DomainModel.expire_time <= notify_expire_time)
| (DomainModel.expire_time.is_null(True))
).order_by(
DomainModel.expire_time.asc(),
DomainModel.id.desc()
Expand Down Expand Up @@ -220,10 +223,13 @@ def notify_user_about_domain_expired(notify_row: NotifyModel):

notify_expire_time = now + timedelta(days=notify_row.expire_days)

# 注意null的情况
rows = DomainInfoModel.select().where(
DomainInfoModel.user_id == notify_row.user_id,
DomainInfoModel.is_expire_monitor == True,
DomainInfoModel.domain_expire_time <= notify_expire_time
).where(
(DomainInfoModel.domain_expire_time <= notify_expire_time)
| (DomainInfoModel.domain_expire_time.is_null(True))
).order_by(
DomainInfoModel.domain_expire_time.asc(),
DomainInfoModel.id.desc()
Expand Down

0 comments on commit f6d63a8

Please sign in to comment.