|
@@ -94,6 +94,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode |
|
|
MediumId: originalWxAdData.MediumId, |
|
|
MediumId: originalWxAdData.MediumId, |
|
|
Uuid: originalWxAdData.Uuid, |
|
|
Uuid: originalWxAdData.Uuid, |
|
|
AppId: originalWxAdData.AppId, |
|
|
AppId: originalWxAdData.AppId, |
|
|
|
|
|
PlatformAppId: originalWxAdData.PlatformAppId, |
|
|
OriginalDataId: originalWxAdData.Id, |
|
|
OriginalDataId: originalWxAdData.Id, |
|
|
SlotId: originalWxAdData.SlotId, |
|
|
SlotId: originalWxAdData.SlotId, |
|
|
AdSlot: originalWxAdData.AdSlot, |
|
|
AdSlot: originalWxAdData.AdSlot, |
|
@@ -135,6 +136,7 @@ func GenerateWxAdData(req md.GenerateWxAdData) (err error, generateWxAdData mode |
|
|
generateWxAdDataWithAgentFlows = append(generateWxAdDataWithAgentFlows, &model.GenerateWxAdDataWithAgentFlow{ |
|
|
generateWxAdDataWithAgentFlows = append(generateWxAdDataWithAgentFlows, &model.GenerateWxAdDataWithAgentFlow{ |
|
|
Uuid: generateWxAdData.Uuid, |
|
|
Uuid: generateWxAdData.Uuid, |
|
|
AppId: generateWxAdData.AppId, |
|
|
AppId: generateWxAdData.AppId, |
|
|
|
|
|
PlatformAppId: generateWxAdData.PlatformAppId, |
|
|
AgentId: v.AgentId, |
|
|
AgentId: v.AgentId, |
|
|
GenerateDataId: generateWxAdData.Id, |
|
|
GenerateDataId: generateWxAdData.Id, |
|
|
SlotId: generateWxAdData.SlotId, |
|
|
SlotId: generateWxAdData.SlotId, |
|
@@ -275,6 +277,7 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
Uuid: originalWxAdData.Uuid, |
|
|
Uuid: originalWxAdData.Uuid, |
|
|
MediumId: originalWxAdData.MediumId, |
|
|
MediumId: originalWxAdData.MediumId, |
|
|
AppId: originalWxAdData.AppId, |
|
|
AppId: originalWxAdData.AppId, |
|
|
|
|
|
PlatformAppId: originalWxAdData.PlatformAppId, |
|
|
BusinessKind: 1, |
|
|
BusinessKind: 1, |
|
|
Kind: medium.SettlementType, |
|
|
Kind: medium.SettlementType, |
|
|
BasicIncome: generateWxAdData.MediaRevenue, |
|
|
BasicIncome: generateWxAdData.MediaRevenue, |
|
@@ -313,6 +316,7 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
Uuid: originalWxAdData.Uuid, |
|
|
Uuid: originalWxAdData.Uuid, |
|
|
MediumId: originalWxAdData.MediumId, |
|
|
MediumId: originalWxAdData.MediumId, |
|
|
AppId: originalWxAdData.AppId, |
|
|
AppId: originalWxAdData.AppId, |
|
|
|
|
|
PlatformAppId: originalWxAdData.PlatformAppId, |
|
|
BusinessKind: 1, |
|
|
BusinessKind: 1, |
|
|
Kind: medium.SettlementType, |
|
|
Kind: medium.SettlementType, |
|
|
BasicIncome: generateWxAdData.MediaRevenue, |
|
|
BasicIncome: generateWxAdData.MediaRevenue, |
|
@@ -401,20 +405,21 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
if agentSettlement == nil { |
|
|
if agentSettlement == nil { |
|
|
//新增一条数据 |
|
|
//新增一条数据 |
|
|
agentSettlement = &model.AgentSettlement{ |
|
|
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) |
|
|
_, err = agentSettlementDb.AgentSettlementInsertBySession(session, agentSettlement) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@@ -434,20 +439,21 @@ func SettlementWxAdData(req md.SettlementWxAdData) (err error) { |
|
|
|
|
|
|
|
|
//新增一条数据 |
|
|
//新增一条数据 |
|
|
agentSettlement = &model.AgentSettlement{ |
|
|
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) |
|
|
_, err = agentSettlementDb.AgentSettlementInsertBySession(session, agentSettlement) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|