mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-09-01 12:26:08 +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 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 {
|
||||
sent: 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"))
|
||||
.first()
|
||||
return {
|
||||
sent: parseInt(progress.sent),
|
||||
pending: parseInt(progress.pending),
|
||||
total: parseInt(progress.total),
|
||||
opens: parseInt(progress.opens),
|
||||
clicks: parseInt(progress.clicks),
|
||||
sent: parseInt(progress.sent ?? 0),
|
||||
pending: parseInt(progress.pending ?? 0),
|
||||
total: parseInt(progress.total ?? 0),
|
||||
opens: parseInt(progress.opens ?? 0),
|
||||
clicks: parseInt(progress.clicks ?? 0),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue