forked from all_user/stat_center
51 lines
1.6 KiB
Go
51 lines
1.6 KiB
Go
package agentSer
|
|
|
|
import (
|
|
"stat/api/proto"
|
|
"stat/models/appInfoMod"
|
|
"stat/models/channelmod"
|
|
)
|
|
|
|
const (
|
|
CPA_SHOW_MONEY = false
|
|
CPS_SHOW_COUNT = true
|
|
)
|
|
|
|
type ChannelMap map[string]*channelmod.ChannelInfo
|
|
type AppMap map[int32]*appInfoMod.AppInfo
|
|
type SourceAgentStatMap map[channelmod.ChannelType]map[string]ChannelAgentStatList
|
|
type OutputStatListType int32
|
|
|
|
type AgentDeductedStatList []*proto.AgentDeductedStat
|
|
|
|
func (a AgentDeductedStatList) Len() int { return len(a) }
|
|
func (a AgentDeductedStatList) Less(i, j int) bool { return a[i].SumDate.After(a[j].SumDate) }
|
|
func (a AgentDeductedStatList) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
|
|
|
const (
|
|
OutputStatListTypeAll OutputStatListType = 0 // 输出当前渠道和直接下级渠道的stat列表
|
|
OutputStatListTypeSelf OutputStatListType = 1 // 输出当前渠道自身的stat列表
|
|
OutputStatListTypeChild OutputStatListType = 2 // 输出直接下级渠道的stat列表
|
|
)
|
|
|
|
type AgentChannelSummaryMode int32
|
|
|
|
const (
|
|
AgentChannelSummaryModeFollowRule AgentChannelSummaryMode = 0 // 按渠道规则,忽略记录中的规则和价格
|
|
AgentChannelSummaryModeFollowRecord AgentChannelSummaryMode = 1 // 按记录中的规则和价格,覆盖渠道规则
|
|
)
|
|
|
|
var (
|
|
GlobalAgentChannelSummaryMode = AgentChannelSummaryModeFollowRule
|
|
)
|
|
|
|
type AgentChannelStat struct {
|
|
channelmod.ChannelStat
|
|
ChildValidDirectCount int64
|
|
ChildValidPayMoney int64
|
|
ChildChannelStats []*AgentChannelStat
|
|
DeductedStat *proto.AgentDeductedStat
|
|
DivideRate int64
|
|
}
|
|
type ChannelAgentStatList []*AgentChannelStat
|