@@ -116,7 +116,7 @@ func FinanceBeforeSevenPoint(c *gin.Context, req md.IndexAppListTableReq) map[st | |||||
for _, v := range date { | for _, v := range date { | ||||
for k1, v1 := range dateList { | for k1, v1 := range dateList { | ||||
if strings.Contains(v1, v["date"]) { | if strings.Contains(v1, v["date"]) { | ||||
appData[v["app_id"]][k1] = utils.Float64ToStr(utils.StrToFloat64(appData[v["app_id"]][k1]) + utils.StrToFloat64(v["media_revenue"])) | |||||
appData[v["app_id"]][k1] = utils.Float64ToStr(utils.StrToFloat64(appData[v["app_id"]][k1]) + utils.StrToFloat64(v["media_revenue"])/100) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -160,7 +160,7 @@ func FinanceIndexAppList(c *gin.Context, req md.IndexAppListReq) md.IndexAppList | |||||
} | } | ||||
dataList := []md.IndexAppListDataList{ | dataList := []md.IndexAppListDataList{ | ||||
{Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, | {Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, | ||||
{Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / float64(day))}, | |||||
{Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100 / utils.StrToFloat64(v["count"]))}, | |||||
{Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, | {Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, | ||||
{Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, | {Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, | ||||
{Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, | {Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, | ||||
@@ -218,6 +218,7 @@ func commFinanceTotal(c *gin.Context, startDate, endDate string) []map[string]st | |||||
func commFinanceTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { | func commFinanceTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { | ||||
sql := ` | sql := ` | ||||
SELECT | SELECT | ||||
COUNT(*) as count, | |||||
app_id as app_id, | app_id as app_id, | ||||
SUM(exposure_count) as exposure_count, | SUM(exposure_count) as exposure_count, | ||||
SUM(click_count) as click_count, | SUM(click_count) as click_count, | ||||
@@ -128,7 +128,7 @@ func BeforeSevenPoint(c *gin.Context, req md.IndexAppListTableReq) map[string][] | |||||
for _, v := range date { | for _, v := range date { | ||||
for k1, v1 := range dateList { | for k1, v1 := range dateList { | ||||
if strings.Contains(v1, v["date"]) { | if strings.Contains(v1, v["date"]) { | ||||
appData[v["app_id"]][k1] = utils.Float64ToStr(utils.StrToFloat64(appData[v["app_id"]][k1]) + utils.StrToFloat64(v["media_revenue"])) | |||||
appData[v["app_id"]][k1] = utils.Float64ToStr(utils.StrToFloat64(appData[v["app_id"]][k1]) + utils.StrToFloat64(v["media_revenue"])/100) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -172,7 +172,7 @@ func IndexAppList(c *gin.Context, req md.IndexAppListReq) md.IndexAppListRes { | |||||
} | } | ||||
dataList := []md.IndexAppListDataList{ | dataList := []md.IndexAppListDataList{ | ||||
{Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, | {Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, | ||||
{Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / float64(day))}, | |||||
{Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100 / utils.StrToFloat64(v["count"]))}, | |||||
{Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, | {Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, | ||||
{Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, | {Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, | ||||
{Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, | {Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, | ||||
@@ -229,6 +229,7 @@ func commTotal(c *gin.Context, startDate, endDate string) []map[string]string { | |||||
func commTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { | func commTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { | ||||
sql := ` | sql := ` | ||||
SELECT | SELECT | ||||
COUNT(*) as count, | |||||
app_id as app_id, | app_id as app_id, | ||||
SUM(exposure_count) as exposure_count, | SUM(exposure_count) as exposure_count, | ||||
SUM(click_count) as click_count, | SUM(click_count) as click_count, | ||||
@@ -79,7 +79,7 @@ func OperatorBeforeSevenPoint(c *gin.Context, req md.IndexAppListTableReq) map[s | |||||
for _, v := range date { | for _, v := range date { | ||||
for k1, v1 := range dateList { | for k1, v1 := range dateList { | ||||
if strings.Contains(v1, v["date"]) { | if strings.Contains(v1, v["date"]) { | ||||
appData[v["app_id"]][k1] = utils.Float64ToStr(utils.StrToFloat64(appData[v["app_id"]][k1]) + utils.StrToFloat64(v["media_revenue"])) | |||||
appData[v["app_id"]][k1] = utils.Float64ToStr(utils.StrToFloat64(appData[v["app_id"]][k1]) + utils.StrToFloat64(v["media_revenue"])/100) | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -123,7 +123,7 @@ func OperatorIndexAppList(c *gin.Context, req md.IndexAppListReq) md.IndexAppLis | |||||
} | } | ||||
dataList := []md.IndexAppListDataList{ | dataList := []md.IndexAppListDataList{ | ||||
{Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, | {Name: "广告预估收益", Type: "media_revenue", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "media_revenue"), Value: utils.Float64ToStr(utils.StrToFloat64(v["media_revenue"]) / 100)}, | ||||
{Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / float64(day))}, | |||||
{Name: "ECPM", Type: "ecpm", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "ecpm"), Value: utils.Float64ToStr(utils.StrToFloat64(v["ecpm"]) / 100 / utils.StrToFloat64(v["count"]))}, | |||||
{Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, | {Name: "曝光量", Type: "exposure_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "exposure_count"), Value: v["exposure_count"]}, | ||||
{Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, | {Name: "点击量", Type: "click_count", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_count"), Value: v["click_count"]}, | ||||
{Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, | {Name: "点击率", Type: "click_rate", Bili: commBili(c, dataLastMap[v["app_id"]], tmpList, "click_rate"), Value: utils.GetPrec(v["click_rate"], "2") + "%"}, | ||||
@@ -180,6 +180,7 @@ func commOperatorTotal(c *gin.Context, startDate, endDate string) []map[string]s | |||||
func commOperatorTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { | func commOperatorTotalByApp(c *gin.Context, req md.IndexAppListReq, appId []string) []map[string]string { | ||||
sql := ` | sql := ` | ||||
SELECT | SELECT | ||||
COUNT(*) as count, | |||||
app_id as app_id, | app_id as app_id, | ||||
SUM(exposure_count) as exposure_count, | SUM(exposure_count) as exposure_count, | ||||
SUM(click_count) as click_count, | SUM(click_count) as click_count, | ||||