правки
This commit is contained in:
@@ -147,6 +147,7 @@ func (s *PurchaseOptionalDetails) HandleCallback(b *bot.Bot, u *echotron.Update)
|
||||
Title: "Дата оплаты",
|
||||
Key: "payment_date",
|
||||
IncludeTime: false,
|
||||
AllowPast: true,
|
||||
Selected: s.PaymentDate,
|
||||
BackState: s,
|
||||
}), bot.EditMessage)
|
||||
@@ -508,7 +509,11 @@ func (s *PurchaseOptionalDetails) costTypeLabel() string {
|
||||
}
|
||||
|
||||
func (s *PurchaseOptionalDetails) costBeforeTypeLabel() string {
|
||||
if s.CostBeforeType == "cpm" {
|
||||
costType := s.CostBeforeType
|
||||
if costType == "" && s.CostBeforeBargain != nil {
|
||||
costType = s.CostBeforeBargain.Type
|
||||
}
|
||||
if costType == "cpm" {
|
||||
return "СРМ"
|
||||
}
|
||||
return "Фикс"
|
||||
@@ -1144,6 +1149,7 @@ func (s *PurchaseOptionalDetails) openCommonEditor(b *bot.Bot, param string) {
|
||||
Title: "Дата и время размещения",
|
||||
Key: "placement_datetime",
|
||||
IncludeTime: true,
|
||||
AllowPast: true,
|
||||
Selected: s.PlacementDateTime,
|
||||
BackState: s,
|
||||
}), bot.EditMessage)
|
||||
@@ -1154,6 +1160,7 @@ func (s *PurchaseOptionalDetails) openCommonEditor(b *bot.Bot, param string) {
|
||||
Title: "Дата оплаты",
|
||||
Key: "payment_date",
|
||||
IncludeTime: false,
|
||||
AllowPast: true,
|
||||
Selected: s.PaymentDate,
|
||||
BackState: s,
|
||||
}), bot.EditMessage)
|
||||
@@ -1201,6 +1208,7 @@ func (s *PurchaseOptionalDetails) openChannelEditor(b *bot.Bot, param, channelKe
|
||||
Title: "Дата и время размещения",
|
||||
Key: "placement_datetime:" + channelKey,
|
||||
IncludeTime: true,
|
||||
AllowPast: true,
|
||||
Selected: s.PlacementByChannel[channelKey],
|
||||
BackState: s,
|
||||
}), bot.EditMessage)
|
||||
@@ -1210,6 +1218,7 @@ func (s *PurchaseOptionalDetails) openChannelEditor(b *bot.Bot, param, channelKe
|
||||
Title: "Дата оплаты",
|
||||
Key: "payment_date:" + channelKey,
|
||||
IncludeTime: false,
|
||||
AllowPast: true,
|
||||
Selected: s.PaymentDateByChannel[channelKey],
|
||||
BackState: s,
|
||||
}), bot.EditMessage)
|
||||
@@ -2093,13 +2102,13 @@ func (s *PurchaseOptionalDetails) toggleCostType() {
|
||||
|
||||
func (s *PurchaseOptionalDetails) toggleCostBeforeType() {
|
||||
if s.CurrentChannel == "" {
|
||||
if s.CostBeforeBargain == nil {
|
||||
s.CostBeforeBargain = &CostEntry{}
|
||||
}
|
||||
if s.costBeforeTypeLabel() == "СРМ" {
|
||||
s.CostBeforeBargain.Type = "fixed"
|
||||
s.CostBeforeType = "fixed"
|
||||
} else {
|
||||
s.CostBeforeBargain.Type = "cpm"
|
||||
s.CostBeforeType = "cpm"
|
||||
}
|
||||
if s.CostBeforeBargain != nil {
|
||||
s.CostBeforeBargain.Type = s.CostBeforeType
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user