Files
2026-05-20 16:13:58 +08:00

700 lines
42 KiB
Go
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package botdailyhourstat
import (
"errors"
"fmt"
"stat/common/statutils"
)
func LineCount(iTemp string, iValue int64, permilValue int64) string {
if permilValue > 1000000 || permilValue < -1000000 {
s1 := fmt.Sprintf("%d", iValue)
str1 := fmt.Sprintf(iTemp, s1)
return str1 + "\n"
} else {
s1 := fmt.Sprintf("%d", iValue)
str1 := fmt.Sprintf(iTemp, s1)
v := float64(permilValue) / 10
str2 := ""
if v < 0 {
str2 = fmt.Sprintf("⬇%.2f%%", v)
} else if v > 0 {
str2 = fmt.Sprintf("⬆+️%.2f%%", v)
} else {
str2 = fmt.Sprintf(" %.2f%%", v)
}
return str1 + str2 + "\n"
}
}
func LineMoneyOne(iTemp string, iValue int64) string {
return LineCountOne(iTemp, iValue/100)
}
func LineCountOne(iTemp string, iValue int64) string {
s1 := fmt.Sprintf("%d", iValue)
str1 := fmt.Sprintf(iTemp, s1)
return str1 + "\n"
}
func LineMoney(iTemp string, iValue int64, permilValue int64) string {
return LineCount(iTemp, iValue/100, permilValue)
}
func (s *StatItem) Display(prefix string) string {
var text string
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "充值总计:")
//text += s.Recharge.DisplayDayHourText(prefix+"┃", 100)
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "老用户充值:")
//text += s.RechargeOldUser.DisplayDayHourText(prefix+"┃", 100)
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "新用户充值:")
//text += s.RechargeNewUser.DisplayDayHourText(prefix+"┃", 100)
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "[会员购买]:")
//text += s.RechargeVip.DisplayDayHourText(prefix+"┃", 100)
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "[金币购买]:")
//text += s.RechargeGold.DisplayDayHourText(prefix+"┃", 100)
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "[订单统计]:")
//text += s.Order.DisplayDayHourText(prefix+"┃", 1)
//text += fmt.Sprintf("%s%s\n", prefix+"┣", "[注册统计]:")
//text += s.Register.DisplayDayHourText(prefix+"┃", 1)
//text += fmt.Sprintf("%s%s\n", prefix+"┗", "[访问统计]:")
//text += s.Visit.DisplayDayHourText(prefix+" ", 1)
return text
}
func (s *BotHourStat) DisplayDayHourText(appName string, compare *BotHourStat) string {
calc := func(curr, hist *statutils.Stat) (*statutils.Stat, *statutils.Stat) {
diff := curr.Sub(hist)
rate := diff.Permil(hist)
return curr, rate
}
rate := func(currValue, histValue int64) int64 {
if histValue != 0 {
return (currValue - histValue) * 1000 / histValue
} else {
return 0
}
}
var text string
text += fmt.Sprintf("应用名称:【%s】\n", appName) //🆚
text += fmt.Sprintf("统计时间:%s\n", s.SumDate.Format("2006-01-02T15:04:05"))
if compare != nil {
func() {
reCurr, reRate := calc(&s.TodayStat.Recharge, &compare.TodayStat.Recharge)
text += "1️⃣当日充值:\n"
text += LineMoney("┣充值合计:%s", reCurr.Value(), reRate.Value())
text += LineMoney("┃┏安卓充值:%s", reCurr.Android.Value(), reRate.Android.Value())
text += LineMoney("┣╋苹果充值:%s", reCurr.Ios.Value(), reRate.Ios.Value())
text += LineMoney("┃┣轻量充值:%s", reCurr.Light.Value(), reRate.Light.Value())
text += LineMoney("┃┗H5充值 :%s", reCurr.H5.Value(), reRate.H5.Value())
text += LineMoney("┃┏渠道充值:%s", reCurr.Total.District.Value, reRate.Total.District.Value)
text += LineMoney("┣╋官网充值:%s", reCurr.Total.Web.Value, reRate.Total.Web.Value)
text += LineMoney("┃┣自来充值:%s", reCurr.Total.Normal.Value, reRate.Total.Normal.Value)
text += LineMoney("┃┗分享充值:%s", reCurr.Total.Share.Value, reRate.Total.Share.Value)
oldCurr, oldRate := calc(&s.TodayStat.RechargeOld, &compare.TodayStat.RechargeOld)
text += LineMoney("┃┏老用户充:%s", oldCurr.Value(), oldRate.Value())
newCurr, newRate := calc(&s.TodayStat.RechargeNew, &compare.TodayStat.RechargeNew)
text += LineMoney("┣╋新用户充:%s", newCurr.Value(), newRate.Value())
v0, v00 := calc(newCurr.Percentage(reCurr), compare.TodayStat.RechargeNew.Percentage(&compare.TodayStat.Recharge))
text += LineCount("┃┗新充占比:%s%%", v0.Value(), v00.Value())
memCurr, memRate := calc(&s.TodayStat.RechargeVip, &compare.TodayStat.RechargeVip)
text += LineMoney("┃┏会员充值:%s", memCurr.Value(), memRate.Value())
coinCurr, coinRate := calc(&s.TodayStat.RechargeGold, &compare.TodayStat.RechargeGold)
text += LineMoney("┣╋金币充值:%s", coinCurr.Value(), coinRate.Value())
v2, v22 := calc(memCurr.Percentage(reCurr), compare.TodayStat.RechargeVip.Percentage(&compare.TodayStat.Recharge))
text += LineCount("┃┗会员占比:%s%%", v2.Value(), v22.Value())
orderCurr, orderRate := calc(&s.TodayStat.Order, &compare.TodayStat.Order)
text += LineCount("┃┏订单拉起:%s", orderCurr.Count(), orderRate.Count())
succCurr, succRate := calc(&s.TodayStat.OrderSucc, &compare.TodayStat.OrderSucc)
text += LineCount("┣╋订单成功:%s", succCurr.Count(), succRate.Count())
v1, v11 := calc(succCurr.Percentage(orderCurr), compare.TodayStat.OrderSucc.Percentage(&compare.TodayStat.Order))
text += LineCount("┃┗成功比率:%s%%", v1.Count(), v11.Count())
text += "2️⃣当日新增:\n"
regCurr, regRate := calc(&s.TodayStat.Register, &compare.TodayStat.Register)
text += LineCount("┣新增用户:%s", regCurr.Count(), regRate.Count())
text += LineCount("┃┏安卓新增:%s", regCurr.Android.Count(), regRate.Android.Count())
text += LineCount("┣╋苹果新增:%s", regCurr.Ios.Count(), regRate.Ios.Count())
text += LineCount("┃┣轻量新增:%s", regCurr.Light.Count(), regRate.Light.Count())
text += LineCount("┃┗H5新增 :%s", regCurr.H5.Count(), regRate.H5.Count())
text += LineCount("┃┏渠道新增:%s", regCurr.Total.District.Count, regRate.Total.District.Count)
text += LineCount("┣╋有效新增:%s", regCurr.Total.Direct.Value()-regCurr.Total.Direct.Natural.Value,
regRate.Total.Direct.Value()-regRate.Total.Direct.Natural.Value)
text += LineCount("┣╋官网新增:%s", regCurr.Total.Web.Count, regRate.Total.Web.Count)
text += LineCount("┃┣自来新增:%s", regCurr.Total.Normal.Count, regRate.Total.Normal.Count)
text += LineCount("┃┗分享新增:%s", regCurr.Total.Share.Count, regRate.Total.Share.Count)
text += "3️⃣当日日活:\n"
visitCurr, visitRate := calc(&s.TodayStat.Visit, &compare.TodayStat.Visit)
text += LineCount("┣日活总数:%s", visitCurr.Count(), visitRate.Count())
text += LineCount("┃┏安卓日活:%s", visitCurr.Android.Count(), visitRate.Android.Count())
text += LineCount("┣╋苹果日活:%s", visitCurr.Ios.Count(), visitRate.Ios.Count())
text += LineCount("┃┣轻量日活:%s", visitCurr.Light.Count(), visitRate.Light.Count())
text += LineCount("┃┗H5日活 :%s", visitCurr.H5.Count(), visitRate.H5.Count())
text += LineCount("┃┏渠道日活:%s", visitCurr.Total.District.Count, visitRate.Total.District.Count)
text += LineCount("┣╋官网日活:%s", visitCurr.Total.Web.Count, visitRate.Total.Web.Count)
text += LineCount("┃┣自来日活:%s", visitCurr.Total.Normal.Count, visitRate.Total.Normal.Count)
text += LineCount("┃┗分享日活:%s", visitCurr.Total.Share.Count, visitRate.Total.Share.Count)
text += "4️⃣落地页点击:\n"
text += LineCount("┣总数:%s", s.TodayLandPage.LandPageTotalClick, rate(s.TodayLandPage.LandPageTotalClick, compare.TodayLandPage.LandPageTotalClick))
text += LineCount("┃┏安卓:%s", s.TodayLandPage.LandPageAndroidClick, rate(s.TodayLandPage.LandPageAndroidClick, compare.TodayLandPage.LandPageAndroidClick))
text += LineCount("┣╋商店:%s", s.TodayLandPage.LandPageIosAppstoreClick, rate(s.TodayLandPage.LandPageIosAppstoreClick, compare.TodayLandPage.LandPageIosAppstoreClick))
text += LineCount("┃┣企业:%s", s.TodayLandPage.LandPageIosFirmClick, rate(s.TodayLandPage.LandPageIosFirmClick, compare.TodayLandPage.LandPageIosFirmClick))
text += LineCount("┃┗轻量:%s", s.TodayLandPage.LandPageIosLightClick, rate(s.TodayLandPage.LandPageIosLightClick, compare.TodayLandPage.LandPageIosLightClick))
}()
func() {
reCurr, reRate := calc(&s.HourStat.Recharge, &compare.HourStat.Recharge)
text += "5️⃣小时充值:\n"
text += LineMoney("┣充值合计:%s", reCurr.Value(), reRate.Value())
text += LineMoney("┃┏安卓充值:%s", reCurr.Android.Value(), reRate.Android.Value())
text += LineMoney("┣╋苹果充值:%s", reCurr.Ios.Value(), reRate.Ios.Value())
text += LineMoney("┃┣轻量充值:%s", reCurr.Light.Value(), reRate.Light.Value())
text += LineMoney("┃┗H5充值 :%s", reCurr.H5.Value(), reRate.H5.Value())
text += LineMoney("┃┏渠道充值:%s", reCurr.Total.District.Value, reRate.Total.District.Value)
text += LineMoney("┣╋官网充值:%s", reCurr.Total.Web.Value, reRate.Total.Web.Value)
text += LineMoney("┃┣自来充值:%s", reCurr.Total.Normal.Value, reRate.Total.Normal.Value)
text += LineMoney("┃┗分享充值:%s", reCurr.Total.Share.Value, reRate.Total.Share.Value)
oldCurr, oldRate := calc(&s.HourStat.RechargeOld, &compare.HourStat.RechargeOld)
text += LineMoney("┃┏老用户充:%s", oldCurr.Value(), oldRate.Value())
newCurr, newRate := calc(&s.HourStat.RechargeNew, &compare.HourStat.RechargeNew)
text += LineMoney("┣╋新用户充:%s", newCurr.Value(), newRate.Value())
v0, v00 := calc(newCurr.Percentage(reCurr), compare.HourStat.RechargeNew.Percentage(&compare.HourStat.Recharge))
text += LineCount("┃┗新充占比:%s%%", v0.Value(), v00.Value())
memCurr, memRate := calc(&s.HourStat.RechargeVip, &compare.HourStat.RechargeVip)
text += LineMoney("┃┏会员充值:%s", memCurr.Value(), memRate.Value())
coinCurr, coinRate := calc(&s.HourStat.RechargeGold, &compare.HourStat.RechargeGold)
text += LineMoney("┣╋金币充值:%s", coinCurr.Value(), coinRate.Value())
v2, v22 := calc(memCurr.Percentage(reCurr), compare.HourStat.RechargeVip.Percentage(&compare.HourStat.Recharge))
text += LineCount("┃┗会员占比:%s%%", v2.Value(), v22.Value())
orderCurr, orderRate := calc(&s.HourStat.Order, &compare.HourStat.Order)
text += LineCount("┃┏订单拉起:%s", orderCurr.Count(), orderRate.Count())
succCurr, succRate := calc(&s.HourStat.OrderSucc, &compare.HourStat.OrderSucc)
text += LineCount("┣╋订单成功:%s", succCurr.Count(), succRate.Count())
v1, v11 := calc(succCurr.Percentage(orderCurr), compare.HourStat.OrderSucc.Percentage(&compare.HourStat.Order))
text += LineCount("┃┗订单成功率:%s%%", v1.Count(), v11.Count())
text += "6️⃣小时新增:\n"
regCurr, regRate := calc(&s.HourStat.Register, &compare.HourStat.Register)
text += LineCount("┣新增用户:%s", regCurr.Count(), regRate.Count())
text += LineCount("┃┏安卓新增:%s", regCurr.Android.Count(), regRate.Android.Count())
text += LineCount("┣╋苹果新增:%s", regCurr.Ios.Count(), regRate.Ios.Count())
text += LineCount("┃┣轻量新增:%s", regCurr.Light.Count(), regRate.Light.Count())
text += LineCount("┃┗H5新增 :%s", regCurr.H5.Count(), regRate.H5.Count())
text += LineCount("┃┏渠道新增:%s", regCurr.Total.District.Count, regRate.Total.District.Count)
text += LineCount("┣╋有效新增:%s", regCurr.Total.Direct.Value()-regCurr.Total.Direct.Natural.Value,
regRate.Total.Direct.Value()-regRate.Total.Direct.Natural.Value)
text += LineCount("┣╋官网新增:%s", regCurr.Total.Web.Count, regRate.Total.Web.Count)
text += LineCount("┃┣自来新增:%s", regCurr.Total.Normal.Count, regRate.Total.Normal.Count)
text += LineCount("┃┗分享新增:%s", regCurr.Total.Share.Count, regRate.Total.Share.Count)
text += "7️⃣小时落地页点击:\n"
text += LineCount("┣总数:%s", s.HourLandPage.LandPageTotalClick, rate(s.HourLandPage.LandPageTotalClick, compare.HourLandPage.LandPageTotalClick))
text += LineCount("┃┏安卓:%s", s.HourLandPage.LandPageAndroidClick, rate(s.HourLandPage.LandPageAndroidClick, compare.HourLandPage.LandPageAndroidClick))
text += LineCount("┣╋商店:%s", s.HourLandPage.LandPageIosAppstoreClick, rate(s.HourLandPage.LandPageIosAppstoreClick, compare.HourLandPage.LandPageIosAppstoreClick))
text += LineCount("┃┣企业:%s", s.HourLandPage.LandPageIosFirmClick, rate(s.HourLandPage.LandPageIosFirmClick, compare.HourLandPage.LandPageIosFirmClick))
text += LineCount("┃┗轻量:%s", s.HourLandPage.LandPageIosLightClick, rate(s.HourLandPage.LandPageIosLightClick, compare.HourLandPage.LandPageIosLightClick))
}()
func() {
if s.TodayGame != nil {
text += "8️⃣游戏数据:\n"
text += fmt.Sprintf("┣游戏充值: %d\n", s.TodayGame.RchgAmount)
text += fmt.Sprintf("┣代充充值: %d\n", s.TodayGame.DcRchgAmount)
text += fmt.Sprintf("┣有效投注: %d\n", s.TodayGame.ValidBet)
text += fmt.Sprintf("┣系统盈利: %d\n", s.TodayGame.Profit)
text += fmt.Sprintf("┣提现金额: %d\n", s.TodayGame.WtdrRealAmount)
text += fmt.Sprintf("┣游戏上分: %d\n", s.TodayGame.IncAmount)
text += fmt.Sprintf("┗游戏下分: %d\n", s.TodayGame.DecAmount)
}
}()
text += fmt.Sprintf("🆚%s同比数据:当日的昨天%d点\n", appName, compare.SumDate.Hour())
} else {
func() {
reCurr := &s.TodayStat.Recharge
text += "1️⃣当日充值:\n"
text += LineMoneyOne("┣充值合计: %s", reCurr.Value())
text += LineMoneyOne("┃┏安卓充值: %s", reCurr.Android.Value())
text += LineMoneyOne("┣╋苹果充值: %s", reCurr.Ios.Value())
text += LineMoneyOne("┃┣轻量充值: %s", reCurr.Light.Value())
text += LineMoneyOne("┃┗H5充值: %s", reCurr.H5.Value())
text += LineMoneyOne("┃┏渠道充值: %s", reCurr.Total.District.Value)
text += LineMoneyOne("┣╋官网充值: %s", reCurr.Total.Web.Value)
text += LineMoneyOne("┃┣自来充值: %s", reCurr.Total.Normal.Value)
text += LineMoneyOne("┃┗分享充值: %s", reCurr.Total.Share.Value)
oldCurr := &s.TodayStat.RechargeOld
text += LineMoneyOne("┃┏老用户充: %s", oldCurr.Value())
newCurr := &s.TodayStat.RechargeNew
text += LineMoneyOne("┣╋新用户充: %s", newCurr.Value())
v0 := newCurr.Percentage(reCurr)
text += LineCountOne("┃┗新充占比: %s%%", v0.Value())
memCurr := &s.TodayStat.RechargeVip
text += LineMoneyOne("┃┏会员充值: %s", memCurr.Value())
coinCurr := &s.TodayStat.RechargeGold
text += LineMoneyOne("┣╋金币充值: %s", coinCurr.Value())
v1 := memCurr.Percentage(reCurr)
text += LineCountOne("┃┗会员占比: %s%%", v1.Value())
orderCurr := &s.TodayStat.Order
text += LineCountOne("┃┏订单拉起: %s", orderCurr.Count())
succCurr := &s.TodayStat.OrderSucc
text += LineCountOne("┣╋订单成功: %s", succCurr.Count())
v2 := succCurr.Percentage(orderCurr)
text += LineCountOne("┃┗成功占比: %s%%", v2.Count())
text += "2️⃣当日新增:\n"
regCurr := &s.TodayStat.Register
text += LineCountOne("┣新增用户: %s", regCurr.Count())
text += LineCountOne("┃┏安卓新增: %s", regCurr.Android.Count())
text += LineCountOne("┣╋苹果新增: %s", regCurr.Ios.Count())
text += LineCountOne("┃┣轻量新增: %s", regCurr.Light.Count())
text += LineCountOne("┃┗H5新增: %s", regCurr.H5.Count())
text += LineCountOne("┃┏渠道新增: %s", regCurr.Total.District.Count)
text += LineCountOne("┣╋官网新增: %s", regCurr.Total.Web.Count)
text += LineCountOne("┃┣自来新增: %s", regCurr.Total.Normal.Count)
text += LineCountOne("┃┗分享新增: %s", regCurr.Total.Share.Count)
text += "3️⃣当日日活:\n"
visitCurr := &s.TodayStat.Visit
text += LineCountOne("┣日活总数: %s", visitCurr.Count())
text += LineCountOne("┃┏安卓日活: %s", visitCurr.Android.Count())
text += LineCountOne("┣╋苹果日活: %s", visitCurr.Ios.Count())
text += LineCountOne("┃┣轻量日活: %s", visitCurr.Light.Count())
text += LineCountOne("┃┗H5日活: %s", visitCurr.H5.Count())
text += LineCountOne("┃┏渠道日活: %s", visitCurr.Total.District.Count)
text += LineCountOne("┣╋官网日活: %s", visitCurr.Total.Web.Count)
text += LineCountOne("┃┣自来日活: %s", visitCurr.Total.Normal.Count)
text += LineCountOne("┃┗分享日活: %s", visitCurr.Total.Share.Count)
}()
func() {
reCurr := &s.HourStat.Recharge
text += "4️⃣小时充值:\n"
text += LineMoneyOne(" ┣充值合计: %s", reCurr.Value())
text += LineMoneyOne(" ┣安卓充值: %s", reCurr.Android.Value())
text += LineMoneyOne(" ┣苹果充值: %s", reCurr.Ios.Value())
text += LineMoneyOne(" ┣轻量充值: %s", reCurr.Light.Value())
text += LineMoneyOne(" ┣H5充值: %s", reCurr.H5.Value())
text += LineMoneyOne(" ┣渠道充值: %s", reCurr.Total.District.Value)
text += LineMoneyOne(" ┣官网充值: %s", reCurr.Total.Web.Value)
text += LineMoneyOne(" ┣自来充值: %s", reCurr.Total.Normal.Value)
oldCurr := &s.HourStat.RechargeOld
text += LineMoneyOne(" ┣老用户充: %s", oldCurr.Value())
newCurr := &s.HourStat.RechargeNew
text += LineMoneyOne(" ┣新用户充: %s", newCurr.Value())
memCurr := &s.HourStat.RechargeVip
text += LineMoneyOne(" ┣会员充值: %s", memCurr.Value())
coinCurr := &s.HourStat.RechargeGold
text += LineMoneyOne(" ┣金币充值: %s", coinCurr.Value())
orderCurr := &s.HourStat.Order
text += LineCountOne(" ┣订单拉起: %s", orderCurr.Count())
succCurr := &s.HourStat.OrderSucc
text += LineCountOne(" ┣订单成功: %s", succCurr.Count())
v1 := succCurr.Percentage(orderCurr)
text += LineCountOne(" ┗订单成功率: %s%%", v1.Count())
text += "5️⃣小时新增:\n"
regCurr := &s.HourStat.Register
text += LineCountOne(" ┣新增用户: %s", regCurr.Count())
text += LineCountOne(" ┣安卓新增: %s", regCurr.Android.Count())
text += LineCountOne(" ┣苹果新增: %s", regCurr.Ios.Count())
text += LineCountOne(" ┣轻量新增: %s", regCurr.Light.Count())
text += LineCountOne(" ┣H5新增: %s", regCurr.H5.Count())
text += LineCountOne(" ┣渠道新增: %s", regCurr.Total.District.Count)
text += LineCountOne(" ┣官网新增: %s", regCurr.Total.Web.Count)
text += LineCountOne(" ┗自来新增: %s", regCurr.Total.Normal.Count)
}()
func() {
if s.TodayGame != nil {
text += "5️⃣游戏数据:\n"
text += fmt.Sprintf(" ┣游戏充值: %d\n", s.TodayGame.RchgAmount)
text += fmt.Sprintf(" ┣代充充值: %d\n", s.TodayGame.DcRchgAmount)
text += fmt.Sprintf(" ┣有效投注: %d\n", s.TodayGame.ValidBet)
text += fmt.Sprintf(" ┣系统盈利: %d\n", s.TodayGame.Profit)
text += fmt.Sprintf(" ┣提现金额: %d\n", s.TodayGame.WtdrRealAmount)
text += fmt.Sprintf(" ┣游戏上分: %d\n", s.TodayGame.IncAmount)
text += fmt.Sprintf(" ┗游戏下分: %d\n", s.TodayGame.DecAmount)
}
}()
text += fmt.Sprintf("🆚【%s】同比数据未找到\n", appName)
}
return text
}
func (s *BotHourStat) DisplaySummaryText(title string) string {
var text string
text += fmt.Sprintf("统计标题:%s\n", title) //
func() {
reCurr := &s.TodayStat.Recharge
text += "1️⃣充值合计:\n"
text += LineMoneyOne("┣充值合计: %s元", reCurr.Value())
text += LineMoneyOne("┃┏安卓充值: %s元", reCurr.Android.Value())
text += LineMoneyOne("┣╋苹果充值: %s元", reCurr.Ios.Value())
text += LineMoneyOne("┃┣轻量充值: %s元", reCurr.Light.Value())
text += LineMoneyOne("┃┗H5充值: %s元", reCurr.H5.Value())
text += LineMoneyOne("┃┏渠道充值: %s元", reCurr.Total.District.Value)
text += LineMoneyOne("┣╋官网充值: %s元", reCurr.Total.Web.Value)
text += LineMoneyOne("┃┣自来充值: %s元", reCurr.Total.Normal.Value)
text += LineMoneyOne("┃┗分享充值: %s元", reCurr.Total.Share.Value)
oldCurr := &s.TodayStat.RechargeOld
text += LineMoneyOne("┃┏老用户充: %s元", oldCurr.Value())
newCurr := &s.TodayStat.RechargeNew
text += LineMoneyOne("┣╋新用户充: %s元", newCurr.Value())
v0 := newCurr.Percentage(reCurr)
text += LineCountOne("┃┗新充占比: %s%%", v0.Value())
memCurr := &s.TodayStat.RechargeVip
text += LineMoneyOne("┃┏会员充值: %s元", memCurr.Value())
coinCurr := &s.TodayStat.RechargeGold
text += LineMoneyOne("┣╋金币充值: %s元", coinCurr.Value())
v1 := memCurr.Percentage(reCurr)
text += LineCountOne("┃┗会员占比: %s%%", v1.Value())
orderCurr := &s.TodayStat.Order
text += LineCountOne("┃┏订单拉起: %s", orderCurr.Count())
succCurr := &s.TodayStat.OrderSucc
text += LineCountOne("┣╋订单成功: %s", succCurr.Count())
v2 := succCurr.Percentage(orderCurr)
text += LineCountOne("┃┗成功占比: %s%%", v2.Count())
text += "2️⃣新增合计:\n"
regCurr := &s.TodayStat.Register
text += LineCountOne("┣新增用户: %s", regCurr.Count())
text += LineCountOne("┃┏安卓新增: %s", regCurr.Android.Count())
text += LineCountOne("┣╋苹果新增: %s", regCurr.Ios.Count())
text += LineCountOne("┃┣轻量新增: %s", regCurr.Light.Count())
text += LineCountOne("┃┗H5新增: %s", regCurr.H5.Count())
text += LineCountOne("┃┏渠道新增: %s", regCurr.Total.District.Count)
text += LineCountOne("┣╋官网新增: %s", regCurr.Total.Web.Count)
text += LineCountOne("┃┣自来新增: %s", regCurr.Total.Normal.Count)
text += LineCountOne("┃┗分享新增: %s", regCurr.Total.Share.Count)
text += "3️⃣日活合计:\n"
visitCurr := &s.TodayStat.Visit
text += LineCountOne("┣日活总数: %s", visitCurr.Count())
text += LineCountOne("┃┏安卓日活: %s", visitCurr.Android.Count())
text += LineCountOne("┣╋苹果日活: %s", visitCurr.Ios.Count())
text += LineCountOne("┃┣轻量日活: %s", visitCurr.Light.Count())
text += LineCountOne("┃┗H5日活: %s", visitCurr.H5.Count())
text += LineCountOne("┃┏渠道日活: %s", visitCurr.Total.District.Count)
text += LineCountOne("┣╋官网日活: %s", visitCurr.Total.Web.Count)
text += LineCountOne("┃┣自来日活: %s", visitCurr.Total.Normal.Count)
text += LineCountOne("┃┗分享日活: %s", visitCurr.Total.Share.Count)
}()
func() {
if s.AppId == 888 && s.TodayGame != nil {
text += "5️⃣游戏合计:\n"
text += fmt.Sprintf("┃┏游戏充值: %d\n", s.TodayGame.RchgAmount)
text += fmt.Sprintf("┃┣代充充值: %d\n", s.TodayGame.DcRchgAmount)
text += fmt.Sprintf("┃┣有效投注: %d\n", s.TodayGame.ValidBet)
text += fmt.Sprintf("┣╋系统盈利: %d\n", s.TodayGame.Profit)
text += fmt.Sprintf("┃┣提现金额: %d\n", s.TodayGame.WtdrRealAmount)
text += fmt.Sprintf("┃┣游戏上分: %d\n", s.TodayGame.IncAmount)
text += fmt.Sprintf("┃┗游戏下分: %d\n", s.TodayGame.DecAmount)
}
}()
return text
}
func (s *BotHourStat) GenerateTodayTable(title string, statName string, filepath string, compare *BotHourStat) (string, error) {
var text string
text += fmt.Sprintf("报告时间:%s\n", s.SumDate.Format("2006-01-02T15:04:05"))
if _, exists := statutils.StatProjectNameDict[statName]; exists {
if compare != nil {
switch statName {
case statutils.StatProjectRecharge:
return text, s.TodayStat.Recharge.Table(title, 100, &compare.TodayStat.Recharge, filepath)
case statutils.StatProjectRechargeOld:
return text, s.TodayStat.RechargeOld.Table(title, 100, &compare.TodayStat.RechargeOld, filepath)
case statutils.StatProjectRechargeNew:
return text, s.TodayStat.RechargeNew.Table(title, 100, &compare.TodayStat.RechargeNew, filepath)
case statutils.StatProjectRechargeGold:
return text, s.TodayStat.RechargeGold.Table(title, 100, &compare.TodayStat.RechargeGold, filepath)
case statutils.StatProjectRechargeVip:
return text, s.TodayStat.RechargeVip.Table(title, 100, &compare.TodayStat.RechargeVip, filepath)
case statutils.StatProjectOrder:
return text, s.TodayStat.Order.Table(title, 1, &compare.TodayStat.Order, filepath)
case statutils.StatProjectRegister:
return text, s.TodayStat.Register.Table(title, 1, &compare.TodayStat.Register, filepath)
case statutils.StatProjectVisit:
return text, s.TodayStat.Visit.Table(title, 1, &compare.TodayStat.Visit, filepath)
default:
return "", errors.New("没有指定统计项目")
}
} else {
switch statName {
case statutils.StatProjectRecharge:
return text, s.TodayStat.Recharge.Table(title, 100, nil, filepath)
case statutils.StatProjectRechargeOld:
return text, s.TodayStat.RechargeOld.Table(title, 100, nil, filepath)
case statutils.StatProjectRechargeNew:
return text, s.TodayStat.RechargeNew.Table(title, 100, nil, filepath)
case statutils.StatProjectRechargeGold:
return text, s.TodayStat.RechargeGold.Table(title, 100, nil, filepath)
case statutils.StatProjectRechargeVip:
return text, s.TodayStat.RechargeVip.Table(title, 100, nil, filepath)
case statutils.StatProjectOrder:
return text, s.TodayStat.Order.Table(title, 1, nil, filepath)
case statutils.StatProjectRegister:
return text, s.TodayStat.Register.Table(title, 1, nil, filepath)
case statutils.StatProjectVisit:
return text, s.TodayStat.Visit.Table(title, 1, nil, filepath)
default:
return "", errors.New("没有指定统计项目")
}
}
} else {
return "", errors.New("没有指定统计项目")
}
}
func (s *BotHourStat) DisplayDayHourTextWithTitle(appName string, compare *BotHourStat) (text string, title string, descript string) {
calc := func(curr, hist *statutils.Stat) (*statutils.Stat, *statutils.Stat) {
diff := curr.Sub(hist)
rate := diff.Permil(hist)
return curr, rate
}
rate := func(currValue, histValue int64) int64 {
if histValue != 0 {
return (currValue - histValue) * 1000 / histValue
} else {
return 0
}
}
title = fmt.Sprintf("%s", appName)
descript = fmt.Sprintf("统计时间: %s\n", s.SumDate.Format("2006-01-02T15"))
if compare != nil {
func() {
reCurr, reRate := calc(&s.TodayStat.Recharge, &compare.TodayStat.Recharge)
text += "1️⃣当日充值:\n"
text += LineMoney("┣充值合计:%s", reCurr.Value(), reRate.Value())
descript += LineMoney(" 今日充值:%s", reCurr.Value(), reRate.Value())
text += LineMoney("┃┏安卓充值:%s", reCurr.Android.Value(), reRate.Android.Value())
text += LineMoney("┣╋苹果充值:%s", reCurr.Ios.Value(), reRate.Ios.Value())
text += LineMoney("┃┣轻量充值:%s", reCurr.Light.Value(), reRate.Light.Value())
text += LineMoney("┃┗H5充值 :%s", reCurr.H5.Value(), reRate.H5.Value())
text += LineMoney("┃┏渠道充值:%s", reCurr.Total.District.Value, reRate.Total.District.Value)
text += LineMoney("┣╋官网充值:%s", reCurr.Total.Web.Value, reRate.Total.Web.Value)
text += LineMoney("┃┣自来充值:%s", reCurr.Total.Normal.Value, reRate.Total.Normal.Value)
text += LineMoney("┃┗分享充值:%s", reCurr.Total.Share.Value, reRate.Total.Share.Value)
oldCurr, oldRate := calc(&s.TodayStat.RechargeOld, &compare.TodayStat.RechargeOld)
text += LineMoney("┃┏老用户充:%s", oldCurr.Value(), oldRate.Value())
newCurr, newRate := calc(&s.TodayStat.RechargeNew, &compare.TodayStat.RechargeNew)
text += LineMoney("┣╋新用户充:%s", newCurr.Value(), newRate.Value())
v0, v00 := calc(newCurr.Percentage(reCurr), compare.TodayStat.RechargeNew.Percentage(&compare.TodayStat.Recharge))
text += LineCount("┃┗新充占比:%s%%", v0.Value(), v00.Value())
memCurr, memRate := calc(&s.TodayStat.RechargeVip, &compare.TodayStat.RechargeVip)
text += LineMoney("┃┏会员充值:%s", memCurr.Value(), memRate.Value())
coinCurr, coinRate := calc(&s.TodayStat.RechargeGold, &compare.TodayStat.RechargeGold)
text += LineMoney("┣╋金币充值:%s", coinCurr.Value(), coinRate.Value())
v2, v22 := calc(memCurr.Percentage(reCurr), compare.TodayStat.RechargeVip.Percentage(&compare.TodayStat.Recharge))
text += LineCount("┃┗会员占比:%s%%", v2.Value(), v22.Value())
orderCurr, orderRate := calc(&s.TodayStat.Order, &compare.TodayStat.Order)
text += LineCount("┃┏订单拉起:%s", orderCurr.Count(), orderRate.Count())
succCurr, succRate := calc(&s.TodayStat.OrderSucc, &compare.TodayStat.OrderSucc)
text += LineCount("┣╋订单成功:%s", succCurr.Count(), succRate.Count())
v1, v11 := calc(succCurr.Percentage(orderCurr), compare.TodayStat.OrderSucc.Percentage(&compare.TodayStat.Order))
text += LineCount("┃┗成功比率:%s%%", v1.Count(), v11.Count())
text += "2️⃣当日新增:\n"
regCurr, regRate := calc(&s.TodayStat.Register, &compare.TodayStat.Register)
text += LineCount("┣新增用户:%s", regCurr.Count(), regRate.Count())
descript += LineCount(" 今日新增:%s", regCurr.Count(), regRate.Count())
text += LineCount("┃┏安卓新增:%s", regCurr.Android.Count(), regRate.Android.Count())
text += LineCount("┣╋苹果新增:%s", regCurr.Ios.Count(), regRate.Ios.Count())
text += LineCount("┃┣轻量新增:%s", regCurr.Light.Count(), regRate.Light.Count())
text += LineCount("┃┗H5新增 :%s", regCurr.H5.Count(), regRate.H5.Count())
text += LineCount("┃┏渠道新增:%s", regCurr.Total.District.Count, regRate.Total.District.Count)
text += LineCount("┣╋有效新增:%s", regCurr.Total.Direct.Value()-regCurr.Total.Direct.Natural.Value,
regRate.Total.Direct.Value()-regRate.Total.Direct.Natural.Value)
text += LineCount("┣╋官网新增:%s", regCurr.Total.Web.Count, regRate.Total.Web.Count)
text += LineCount("┃┣自来新增:%s", regCurr.Total.Normal.Count, regRate.Total.Normal.Count)
text += LineCount("┃┗分享新增:%s", regCurr.Total.Share.Count, regRate.Total.Share.Count)
text += "3️⃣当日日活:\n"
visitCurr, visitRate := calc(&s.TodayStat.Visit, &compare.TodayStat.Visit)
text += LineCount("┣日活总数:%s", visitCurr.Count(), visitRate.Count())
text += LineCount("┃┏安卓日活:%s", visitCurr.Android.Count(), visitRate.Android.Count())
text += LineCount("┣╋苹果日活:%s", visitCurr.Ios.Count(), visitRate.Ios.Count())
text += LineCount("┃┣轻量日活:%s", visitCurr.Light.Count(), visitRate.Light.Count())
text += LineCount("┃┗H5日活 :%s", visitCurr.H5.Count(), visitRate.H5.Count())
text += LineCount("┃┏渠道日活:%s", visitCurr.Total.District.Count, visitRate.Total.District.Count)
text += LineCount("┣╋官网日活:%s", visitCurr.Total.Web.Count, visitRate.Total.Web.Count)
text += LineCount("┃┣自来日活:%s", visitCurr.Total.Normal.Count, visitRate.Total.Normal.Count)
text += LineCount("┃┗分享日活:%s", visitCurr.Total.Share.Count, visitRate.Total.Share.Count)
text += "4️⃣落地页点击:\n"
text += LineCount("┣总数:%s", s.TodayLandPage.LandPageTotalClick, rate(s.TodayLandPage.LandPageTotalClick, compare.TodayLandPage.LandPageTotalClick))
text += LineCount("┃┏安卓:%s", s.TodayLandPage.LandPageAndroidClick, rate(s.TodayLandPage.LandPageAndroidClick, compare.TodayLandPage.LandPageAndroidClick))
text += LineCount("┣╋商店:%s", s.TodayLandPage.LandPageIosAppstoreClick, rate(s.TodayLandPage.LandPageIosAppstoreClick, compare.TodayLandPage.LandPageIosAppstoreClick))
text += LineCount("┃┣企业:%s", s.TodayLandPage.LandPageIosFirmClick, rate(s.TodayLandPage.LandPageIosFirmClick, compare.TodayLandPage.LandPageIosFirmClick))
text += LineCount("┃┗轻量:%s", s.TodayLandPage.LandPageIosLightClick, rate(s.TodayLandPage.LandPageIosLightClick, compare.TodayLandPage.LandPageIosLightClick))
}()
func() {
reCurr, reRate := calc(&s.HourStat.Recharge, &compare.HourStat.Recharge)
text += "5️⃣小时充值:\n"
text += LineMoney("┣充值合计:%s", reCurr.Value(), reRate.Value())
descript += LineMoney(" 小时充值:%s", reCurr.Value(), reRate.Value())
text += LineMoney("┃┏安卓充值:%s", reCurr.Android.Value(), reRate.Android.Value())
text += LineMoney("┣╋苹果充值:%s", reCurr.Ios.Value(), reRate.Ios.Value())
text += LineMoney("┃┣轻量充值:%s", reCurr.Light.Value(), reRate.Light.Value())
text += LineMoney("┃┗H5充值 :%s", reCurr.H5.Value(), reRate.H5.Value())
text += LineMoney("┃┏渠道充值:%s", reCurr.Total.District.Value, reRate.Total.District.Value)
text += LineMoney("┣╋官网充值:%s", reCurr.Total.Web.Value, reRate.Total.Web.Value)
text += LineMoney("┃┣自来充值:%s", reCurr.Total.Normal.Value, reRate.Total.Normal.Value)
text += LineMoney("┃┗分享充值:%s", reCurr.Total.Share.Value, reRate.Total.Share.Value)
oldCurr, oldRate := calc(&s.HourStat.RechargeOld, &compare.HourStat.RechargeOld)
text += LineMoney("┃┏老用户充:%s", oldCurr.Value(), oldRate.Value())
newCurr, newRate := calc(&s.HourStat.RechargeNew, &compare.HourStat.RechargeNew)
text += LineMoney("┣╋新用户充:%s", newCurr.Value(), newRate.Value())
v0, v00 := calc(newCurr.Percentage(reCurr), compare.HourStat.RechargeNew.Percentage(&compare.HourStat.Recharge))
text += LineCount("┃┗新充占比:%s%%", v0.Value(), v00.Value())
memCurr, memRate := calc(&s.HourStat.RechargeVip, &compare.HourStat.RechargeVip)
text += LineMoney("┃┏会员充值:%s", memCurr.Value(), memRate.Value())
coinCurr, coinRate := calc(&s.HourStat.RechargeGold, &compare.HourStat.RechargeGold)
text += LineMoney("┣╋金币充值:%s", coinCurr.Value(), coinRate.Value())
v2, v22 := calc(memCurr.Percentage(reCurr), compare.HourStat.RechargeVip.Percentage(&compare.HourStat.Recharge))
text += LineCount("┃┗会员占比:%s%%", v2.Value(), v22.Value())
orderCurr, orderRate := calc(&s.HourStat.Order, &compare.HourStat.Order)
text += LineCount("┃┏订单拉起:%s", orderCurr.Count(), orderRate.Count())
succCurr, succRate := calc(&s.HourStat.OrderSucc, &compare.HourStat.OrderSucc)
text += LineCount("┣╋订单成功:%s", succCurr.Count(), succRate.Count())
v1, v11 := calc(succCurr.Percentage(orderCurr), compare.HourStat.OrderSucc.Percentage(&compare.HourStat.Order))
text += LineCount("┃┗订单成功率:%s%%", v1.Count(), v11.Count())
text += "6️⃣小时新增:\n"
regCurr, regRate := calc(&s.HourStat.Register, &compare.HourStat.Register)
text += LineCount("┣新增用户:%s", regCurr.Count(), regRate.Count())
descript += LineCount(" 小时新增:%s", regCurr.Count(), regRate.Count())
text += LineCount("┃┏安卓新增:%s", regCurr.Android.Count(), regRate.Android.Count())
text += LineCount("┣╋苹果新增:%s", regCurr.Ios.Count(), regRate.Ios.Count())
text += LineCount("┃┣轻量新增:%s", regCurr.Light.Count(), regRate.Light.Count())
text += LineCount("┃┗H5新增 :%s", regCurr.H5.Count(), regRate.H5.Count())
text += LineCount("┃┏渠道新增:%s", regCurr.Total.District.Count, regRate.Total.District.Count)
text += LineCount("┣╋有效新增:%s", regCurr.Total.Direct.Value()-regCurr.Total.Direct.Natural.Value,
regRate.Total.Direct.Value()-regRate.Total.Direct.Natural.Value)
text += LineCount("┣╋官网新增:%s", regCurr.Total.Web.Count, regRate.Total.Web.Count)
text += LineCount("┃┣自来新增:%s", regCurr.Total.Normal.Count, regRate.Total.Normal.Count)
text += LineCount("┃┗分享新增:%s", regCurr.Total.Share.Count, regRate.Total.Share.Count)
text += "7️⃣小时落地页点击:\n"
text += LineCount("┣总数:%s", s.HourLandPage.LandPageTotalClick, rate(s.HourLandPage.LandPageTotalClick, compare.HourLandPage.LandPageTotalClick))
text += LineCount("┃┏安卓:%s", s.HourLandPage.LandPageAndroidClick, rate(s.HourLandPage.LandPageAndroidClick, compare.HourLandPage.LandPageAndroidClick))
text += LineCount("┣╋商店:%s", s.HourLandPage.LandPageIosAppstoreClick, rate(s.HourLandPage.LandPageIosAppstoreClick, compare.HourLandPage.LandPageIosAppstoreClick))
text += LineCount("┃┣企业:%s", s.HourLandPage.LandPageIosFirmClick, rate(s.HourLandPage.LandPageIosFirmClick, compare.HourLandPage.LandPageIosFirmClick))
text += LineCount("┃┗轻量:%s", s.HourLandPage.LandPageIosLightClick, rate(s.HourLandPage.LandPageIosLightClick, compare.HourLandPage.LandPageIosLightClick))
}()
func() {
if s.TodayGame != nil {
text += "8️⃣游戏数据:\n"
text += fmt.Sprintf("┣游戏充值: %d\n", s.TodayGame.RchgAmount)
text += fmt.Sprintf("┣代充充值: %d\n", s.TodayGame.DcRchgAmount)
text += fmt.Sprintf("┣有效投注: %d\n", s.TodayGame.ValidBet)
text += fmt.Sprintf("┣系统盈利: %d\n", s.TodayGame.Profit)
text += fmt.Sprintf("┣提现金额: %d\n", s.TodayGame.WtdrRealAmount)
text += fmt.Sprintf("┣游戏上分: %d\n", s.TodayGame.IncAmount)
text += fmt.Sprintf("┗游戏下分: %d\n", s.TodayGame.DecAmount)
}
}()
text += fmt.Sprintf("🆚%s同比数据:当日的昨天%d点\n", appName, compare.SumDate.Hour())
} else {
func() {
reCurr := &s.TodayStat.Recharge
text += "1️⃣当日充值:\n"
text += LineMoneyOne("┣充值合计: %s", reCurr.Value())
text += LineMoneyOne("┃┏安卓充值: %s", reCurr.Android.Value())
text += LineMoneyOne("┣╋苹果充值: %s", reCurr.Ios.Value())
text += LineMoneyOne("┃┣轻量充值: %s", reCurr.Light.Value())
text += LineMoneyOne("┃┗H5充值: %s", reCurr.H5.Value())
text += LineMoneyOne("┃┏渠道充值: %s", reCurr.Total.District.Value)
text += LineMoneyOne("┣╋官网充值: %s", reCurr.Total.Web.Value)
text += LineMoneyOne("┃┣自来充值: %s", reCurr.Total.Normal.Value)
text += LineMoneyOne("┃┗分享充值: %s", reCurr.Total.Share.Value)
oldCurr := &s.TodayStat.RechargeOld
text += LineMoneyOne("┃┏老用户充: %s", oldCurr.Value())
newCurr := &s.TodayStat.RechargeNew
text += LineMoneyOne("┣╋新用户充: %s", newCurr.Value())
v0 := newCurr.Percentage(reCurr)
text += LineCountOne("┃┗新充占比: %s%%", v0.Value())
memCurr := &s.TodayStat.RechargeVip
text += LineMoneyOne("┃┏会员充值: %s", memCurr.Value())
coinCurr := &s.TodayStat.RechargeGold
text += LineMoneyOne("┣╋金币充值: %s", coinCurr.Value())
v1 := memCurr.Percentage(reCurr)
text += LineCountOne("┃┗会员占比: %s%%", v1.Value())
orderCurr := &s.TodayStat.Order
text += LineCountOne("┃┏订单拉起: %s", orderCurr.Count())
succCurr := &s.TodayStat.OrderSucc
text += LineCountOne("┣╋订单成功: %s", succCurr.Count())
v2 := succCurr.Percentage(orderCurr)
text += LineCountOne("┃┗成功占比: %s%%", v2.Count())
text += "2️⃣当日新增:\n"
regCurr := &s.TodayStat.Register
text += LineCountOne("┣新增用户: %s", regCurr.Count())
text += LineCountOne("┃┏安卓新增: %s", regCurr.Android.Count())
text += LineCountOne("┣╋苹果新增: %s", regCurr.Ios.Count())
text += LineCountOne("┃┣轻量新增: %s", regCurr.Light.Count())
text += LineCountOne("┃┗H5新增: %s", regCurr.H5.Count())
text += LineCountOne("┃┏渠道新增: %s", regCurr.Total.District.Count)
text += LineCountOne("┣╋官网新增: %s", regCurr.Total.Web.Count)
text += LineCountOne("┃┣自来新增: %s", regCurr.Total.Normal.Count)
text += LineCountOne("┃┗分享新增: %s", regCurr.Total.Share.Count)
text += "3️⃣当日日活:\n"
visitCurr := &s.TodayStat.Visit
text += LineCountOne("┣日活总数: %s", visitCurr.Count())
text += LineCountOne("┃┏安卓日活: %s", visitCurr.Android.Count())
text += LineCountOne("┣╋苹果日活: %s", visitCurr.Ios.Count())
text += LineCountOne("┃┣轻量日活: %s", visitCurr.Light.Count())
text += LineCountOne("┃┗H5日活: %s", visitCurr.H5.Count())
text += LineCountOne("┃┏渠道日活: %s", visitCurr.Total.District.Count)
text += LineCountOne("┣╋官网日活: %s", visitCurr.Total.Web.Count)
text += LineCountOne("┃┣自来日活: %s", visitCurr.Total.Normal.Count)
text += LineCountOne("┃┗分享日活: %s", visitCurr.Total.Share.Count)
}()
func() {
reCurr := &s.HourStat.Recharge
text += "4️⃣小时充值:\n"
text += LineMoneyOne(" ┣充值合计: %s", reCurr.Value())
text += LineMoneyOne(" ┣安卓充值: %s", reCurr.Android.Value())
text += LineMoneyOne(" ┣苹果充值: %s", reCurr.Ios.Value())
text += LineMoneyOne(" ┣轻量充值: %s", reCurr.Light.Value())
text += LineMoneyOne(" ┣H5充值: %s", reCurr.H5.Value())
text += LineMoneyOne(" ┣渠道充值: %s", reCurr.Total.District.Value)
text += LineMoneyOne(" ┣官网充值: %s", reCurr.Total.Web.Value)
text += LineMoneyOne(" ┣自来充值: %s", reCurr.Total.Normal.Value)
oldCurr := &s.HourStat.RechargeOld
text += LineMoneyOne(" ┣老用户充: %s", oldCurr.Value())
newCurr := &s.HourStat.RechargeNew
text += LineMoneyOne(" ┣新用户充: %s", newCurr.Value())
memCurr := &s.HourStat.RechargeVip
text += LineMoneyOne(" ┣会员充值: %s", memCurr.Value())
coinCurr := &s.HourStat.RechargeGold
text += LineMoneyOne(" ┣金币充值: %s", coinCurr.Value())
orderCurr := &s.HourStat.Order
text += LineCountOne(" ┣订单拉起: %s", orderCurr.Count())
succCurr := &s.HourStat.OrderSucc
text += LineCountOne(" ┣订单成功: %s", succCurr.Count())
v1 := succCurr.Percentage(orderCurr)
text += LineCountOne(" ┗订单成功率: %s%%", v1.Count())
text += "5️⃣小时新增:\n"
regCurr := &s.HourStat.Register
text += LineCountOne(" ┣新增用户: %s", regCurr.Count())
text += LineCountOne(" ┣安卓新增: %s", regCurr.Android.Count())
text += LineCountOne(" ┣苹果新增: %s", regCurr.Ios.Count())
text += LineCountOne(" ┣轻量新增: %s", regCurr.Light.Count())
text += LineCountOne(" ┣H5新增: %s", regCurr.H5.Count())
text += LineCountOne(" ┣渠道新增: %s", regCurr.Total.District.Count)
text += LineCountOne(" ┣官网新增: %s", regCurr.Total.Web.Count)
text += LineCountOne(" ┗自来新增: %s", regCurr.Total.Normal.Count)
}()
func() {
if s.TodayGame != nil {
text += "5️⃣游戏数据:\n"
text += fmt.Sprintf(" ┣游戏充值: %d\n", s.TodayGame.RchgAmount)
text += fmt.Sprintf(" ┣代充充值: %d\n", s.TodayGame.DcRchgAmount)
text += fmt.Sprintf(" ┣有效投注: %d\n", s.TodayGame.ValidBet)
text += fmt.Sprintf(" ┣系统盈利: %d\n", s.TodayGame.Profit)
text += fmt.Sprintf(" ┣提现金额: %d\n", s.TodayGame.WtdrRealAmount)
text += fmt.Sprintf(" ┣游戏上分: %d\n", s.TodayGame.IncAmount)
text += fmt.Sprintf(" ┗游戏下分: %d\n", s.TodayGame.DecAmount)
}
}()
text += fmt.Sprintf("🆚【%s】同比数据未找到\n", appName)
}
return text, title, descript
}