|
|
@@ -94,6 +94,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
Uuid: originalWxAdData.Uuid, |
|
|
|
AppId: originalWxAdData.AppId, |
|
|
|
PlatformAppId: originalWxAdData.PlatformAppId, |
|
|
|
OriginalDataId: originalWxAdData.Id, |
|
|
|
SlotId: originalWxAdData.SlotId, |
|
|
|
AdSlot: originalWxAdData.AdSlot, |
|
|
@@ -135,6 +136,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode |
|
|
|
generateWxAdDataWithAgentFlows = append(generateWxAdDataWithAgentFlows, &model.GenerateWxAdDataWithAgentFlow{ |
|
|
|
Uuid: generateWxAdData.Uuid, |
|
|
|
AppId: generateWxAdData.AppId, |
|
|
|
PlatformAppId: generateWxAdData.PlatformAppId, |
|
|
|
AgentId: v.AgentId, |
|
|
|
GenerateDataId: generateWxAdData.Id, |
|
|
|
SlotId: generateWxAdData.SlotId, |
|
|
@@ -275,6 +277,7 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
|
Uuid: originalWxAdData.Uuid, |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
AppId: originalWxAdData.AppId, |
|
|
|
PlatformAppId: originalWxAdData.PlatformAppId, |
|
|
|
BusinessKind: 1, |
|
|
|
Kind: medium.SettlementType, |
|
|
|
BasicIncome: generateWxAdData.MediaRevenue, |
|
|
@@ -313,6 +316,7 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
|
Uuid: originalWxAdData.Uuid, |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
AppId: originalWxAdData.AppId, |
|
|
|
PlatformAppId: originalWxAdData.PlatformAppId, |
|
|
|
BusinessKind: 1, |
|
|
|
Kind: medium.SettlementType, |
|
|
|
BasicIncome: generateWxAdData.MediaRevenue, |
|
|
@@ -401,20 +405,21 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
|
if agentSettlement == nil { |
|
|
|
//新增一条数据 |
|
|
|
agentSettlement = &model.AgentSettlement{ |
|
|
|
Uuid: v.Uuid, |
|
|
|
AgentId: v.AgentId, |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
AppId: v.AppId, |
|
|
|
BusinessKind: 1, |
|
|
|
Kind: agentMap[v.AgentId].SettlementType, |
|
|
|
BasicIncome: v.AgentRevenue, |
|
|
|
OtherIncome: v.ExtraRevenue, |
|
|
|
State: agentSettlementState, |
|
|
|
PayState: agentSettlementPayState, |
|
|
|
StartDate: now.Format("2006-01-02"), |
|
|
|
EndDate: "", |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
Uuid: v.Uuid, |
|
|
|
AgentId: v.AgentId, |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
AppId: v.AppId, |
|
|
|
PlatformAppId: v.PlatformAppId, |
|
|
|
BusinessKind: 1, |
|
|
|
Kind: agentMap[v.AgentId].SettlementType, |
|
|
|
BasicIncome: v.AgentRevenue, |
|
|
|
OtherIncome: v.ExtraRevenue, |
|
|
|
State: agentSettlementState, |
|
|
|
PayState: agentSettlementPayState, |
|
|
|
StartDate: now.Format("2006-01-02"), |
|
|
|
EndDate: "", |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
} |
|
|
|
_, err = agentSettlementDb.AgentSettlementInsertBySession(session, agentSettlement) |
|
|
|
if err != nil { |
|
|
@@ -434,20 +439,21 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
|
|
|
|
|
//新增一条数据 |
|
|
|
agentSettlement = &model.AgentSettlement{ |
|
|
|
Uuid: v.Uuid, |
|
|
|
AgentId: v.AgentId, |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
AppId: v.AppId, |
|
|
|
BusinessKind: 1, |
|
|
|
Kind: agentMap[v.AgentId].SettlementType, |
|
|
|
BasicIncome: v.AgentRevenue, |
|
|
|
OtherIncome: v.ExtraRevenue, |
|
|
|
State: agentSettlementState, |
|
|
|
PayState: agentSettlementPayState, |
|
|
|
StartDate: now.Format("2006-01-02"), |
|
|
|
EndDate: "", |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
Uuid: v.Uuid, |
|
|
|
AgentId: v.AgentId, |
|
|
|
MediumId: originalWxAdData.MediumId, |
|
|
|
AppId: v.AppId, |
|
|
|
PlatformAppId: v.PlatformAppId, |
|
|
|
BusinessKind: 1, |
|
|
|
Kind: agentMap[v.AgentId].SettlementType, |
|
|
|
BasicIncome: v.AgentRevenue, |
|
|
|
OtherIncome: v.ExtraRevenue, |
|
|
|
State: agentSettlementState, |
|
|
|
PayState: agentSettlementPayState, |
|
|
|
StartDate: now.Format("2006-01-02"), |
|
|
|
EndDate: "", |
|
|
|
CreateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
UpdateAt: now.Format("2006-01-02 15:04:05"), |
|
|
|
} |
|
|
|
_, err = agentSettlementDb.AgentSettlementInsertBySession(session, agentSettlement) |
|
|
|
if err != nil { |
|
|
|