mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-04 12:56:14 +08:00
Minor bug fixes
This commit is contained in:
parent
2b437197b1
commit
60802584b2
2 changed files with 6 additions and 6 deletions
|
@ -5,7 +5,7 @@ import List from '../lists/List'
|
||||||
import Template from '../render/Template'
|
import Template from '../render/Template'
|
||||||
import Subscription from '../subscriptions/Subscription'
|
import Subscription from '../subscriptions/Subscription'
|
||||||
|
|
||||||
export type CampaignState = 'draft' | 'pending' | 'scheduled' | 'running' | 'finished' | 'aborted'
|
export type CampaignState = 'draft' | 'scheduled' | 'pending' | 'running' | 'finished' | 'aborted'
|
||||||
export interface CampaignDelivery {
|
export interface CampaignDelivery {
|
||||||
sent: number
|
sent: number
|
||||||
total: number
|
total: number
|
||||||
|
|
|
@ -348,11 +348,11 @@ export const campaignProgress = async (campaign: Campaign): Promise<CampaignProg
|
||||||
.select(CampaignSend.raw("SUM(IF(state = 'sent', 1, 0)) AS sent, SUM(IF(state = 'pending', 1, 0)) AS pending, COUNT(*) AS total, SUM(IF(opened_at IS NOT NULL, 1, 0)) AS opens, SUM(IF(clicks > 0, 1, 0)) AS clicks"))
|
.select(CampaignSend.raw("SUM(IF(state = 'sent', 1, 0)) AS sent, SUM(IF(state = 'pending', 1, 0)) AS pending, COUNT(*) AS total, SUM(IF(opened_at IS NOT NULL, 1, 0)) AS opens, SUM(IF(clicks > 0, 1, 0)) AS clicks"))
|
||||||
.first()
|
.first()
|
||||||
return {
|
return {
|
||||||
sent: parseInt(progress.sent),
|
sent: parseInt(progress.sent ?? 0),
|
||||||
pending: parseInt(progress.pending),
|
pending: parseInt(progress.pending ?? 0),
|
||||||
total: parseInt(progress.total),
|
total: parseInt(progress.total ?? 0),
|
||||||
opens: parseInt(progress.opens),
|
opens: parseInt(progress.opens ?? 0),
|
||||||
clicks: parseInt(progress.clicks),
|
clicks: parseInt(progress.clicks ?? 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue