You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
283 lines
11 KiB
283 lines
11 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
using Sog;
|
|
|
|
namespace bill_statistics
|
|
{
|
|
public static partial class LogWrapper
|
|
{
|
|
|
|
public static void PrintAllLostUserChip()
|
|
{
|
|
PrintAllLostUserChip7();
|
|
//PrintAllLostUserChip1();
|
|
|
|
PrintLostNewUserChip1();
|
|
PrintLostNewUserChip7();
|
|
|
|
PrintBrokenUserLost();
|
|
}
|
|
|
|
public static void PrintAllLostUserChip1()
|
|
{
|
|
FileStream fsFile = new FileStream("./bill_out_lostUserChip1Day.txt", FileMode.Create);
|
|
|
|
StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8);
|
|
string strMessage = "Date\tLostUserID\tChip\t是否Facebook用户\t玩牌次数\t破产补助次数" /*+ "否完成新手引导\t新手引导步骤\t"*/;
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
foreach (KeyValuePair<DateTime, BillInfoEveryDay> pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
DateTime dateTime = pair.Key;
|
|
BillInfoEveryDay info = pair.Value;
|
|
|
|
foreach (KeyValuePair<int, UserInfo> data in info.m_activeUser)
|
|
{
|
|
if (data.Value.secondDayNotLogin)
|
|
{
|
|
strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}",
|
|
dateTime.Year, dateTime.Month, dateTime.Day, data.Value.Uid,
|
|
info.GetUserLogoutChip(data.Value.Uid),
|
|
info.IsFaceBookUser(data.Value.Uid),
|
|
info.GetBrokenGrandTimes(data.Value.Uid)
|
|
//info.IsFinishNewbieGuide(data.Value.Uid),
|
|
//info.GetFinishNewbitStep(data.Value.Uid)
|
|
);
|
|
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
fileWriter.Dispose();
|
|
fsFile.Dispose();
|
|
}
|
|
|
|
public static void PrintLostNewUserChip1()
|
|
{
|
|
FileStream fsFile = new FileStream("./bill_out_lostNewUserChip1Day.txt", FileMode.Create);
|
|
|
|
StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8);
|
|
string strMessage = "Date\tLostUserID\tChip\t是否Facebook用户\t玩牌次数\t赢牌次数\t是否完成新手引导\t新手引导步骤\t破产补助次数\t领取签到奖励\t是否鱼虾蟹\tFB好友数量";
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
foreach (KeyValuePair<DateTime, BillInfoEveryDay> pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
DateTime dateTime = pair.Key;
|
|
BillInfoEveryDay info = pair.Value;
|
|
|
|
foreach (KeyValuePair<int, UserInfo> data in info.m_newUser)
|
|
{
|
|
if (data.Value.secondDayNotLogin)
|
|
{
|
|
strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}",
|
|
dateTime.Year, dateTime.Month, dateTime.Day, data.Value.Uid,
|
|
info.GetUserLogoutChip(data.Value.Uid),
|
|
info.IsFaceBookUser(data.Value.Uid),
|
|
info.IsFinishNewbieGuide(data.Value.Uid),
|
|
info.GetFinishNewbitStep(data.Value.Uid),
|
|
info.GetBrokenGrandTimes(data.Value.Uid),
|
|
info.IsGetSignReward(data.Value.Uid),
|
|
0,
|
|
info.GetFBFriendCount(data.Value.Uid)
|
|
);
|
|
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
fileWriter.Dispose();
|
|
fsFile.Dispose();
|
|
}
|
|
|
|
public static void PrintAllLostUserChip7()
|
|
{
|
|
FileStream fsFile = new FileStream("./bill_out_lostUserChip7Day.txt", FileMode.Create);
|
|
|
|
StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8);
|
|
string strMessage = "Date\tLostUserID\tChip\t是否Facebook用户\t玩牌次数\t是否完成新手引导\t新手引导步骤\t破产补助次数";
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
foreach (KeyValuePair<DateTime, BillInfoEveryDay> pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
DateTime dateTime = pair.Key;
|
|
BillInfoEveryDay info = pair.Value;
|
|
|
|
foreach (KeyValuePair<int, UserInfo> data in info.m_activeUser)
|
|
{
|
|
if (data.Value.notLoginDayCount >= BillAlldays.Instance.GetOffDay(dateTime))
|
|
{
|
|
strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}",
|
|
dateTime.Year, dateTime.Month, dateTime.Day, data.Value.Uid,
|
|
info.GetUserLogoutChip(data.Value.Uid),
|
|
info.IsFaceBookUser(data.Value.Uid),
|
|
info.IsFinishNewbieGuide(data.Value.Uid),
|
|
info.GetFinishNewbitStep(data.Value.Uid),
|
|
info.GetBrokenGrandTimes(data.Value.Uid)
|
|
);
|
|
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
fileWriter.Dispose();
|
|
fsFile.Dispose();
|
|
}
|
|
|
|
public static void PrintLostNewUserChip7()
|
|
{
|
|
FileStream fsFile = new FileStream("./bill_out_lostNewUserChip7Day.txt", FileMode.Create);
|
|
|
|
StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8);
|
|
string strMessage = "Date\tLostUserID\tChip\t是否Facebook用户\t玩牌次数\t是否完成新手引导\t新手引导步骤\t破产补助次数";
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
foreach (KeyValuePair<DateTime, BillInfoEveryDay> pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
DateTime dateTime = pair.Key;
|
|
BillInfoEveryDay info = pair.Value;
|
|
|
|
foreach (KeyValuePair<int, UserInfo> data in info.m_newUser)
|
|
{
|
|
if (data.Value.notLoginDayCount >= BillAlldays.Instance.GetOffDay(dateTime))
|
|
{
|
|
strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}",
|
|
dateTime.Year, dateTime.Month, dateTime.Day, data.Value.Uid,
|
|
info.GetUserLogoutChip(data.Value.Uid),
|
|
info.IsFaceBookUser(data.Value.Uid),
|
|
info.IsFinishNewbieGuide(data.Value.Uid),
|
|
info.GetFinishNewbitStep(data.Value.Uid),
|
|
info.GetBrokenGrandTimes(data.Value.Uid)
|
|
);
|
|
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
fileWriter.Dispose();
|
|
fsFile.Dispose();
|
|
}
|
|
|
|
public static void PrintLoseLess10000()
|
|
{
|
|
|
|
foreach(var pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
var info = pair.Value;
|
|
DateTime dateTime = pair.Key;
|
|
if((dateTime.Month == 7 && dateTime.Day == 4)||
|
|
(dateTime.Month == 7 && dateTime.Day == 5) ||
|
|
(dateTime.Month == 7 && dateTime.Day == 6)
|
|
)
|
|
{
|
|
for(int i = 1; i < 4; i ++)
|
|
{
|
|
var newDate = dateTime.AddDays(i);
|
|
if (BillAlldays.Instance.m_billAllDays.ContainsKey(newDate))
|
|
{
|
|
foreach (KeyValuePair<int, UserInfo> newpair in info.m_newUser)
|
|
{
|
|
if(BillAlldays.Instance.m_billAllDays[newDate].m_activeUser.ContainsKey(newpair.Value.Uid))
|
|
{
|
|
newpair.Value.bLoseLess10000 ++;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
FileStream fsFile = new FileStream("./loseLess10000.txt", FileMode.Create);
|
|
StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8);
|
|
string strMessage = "Date\tuid";
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
foreach (var pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
var info = pair.Value;
|
|
DateTime dateTime = pair.Key;
|
|
if ((dateTime.Month == 7 && dateTime.Day == 4) ||
|
|
(dateTime.Month == 7 && dateTime.Day == 5) ||
|
|
(dateTime.Month == 7 && dateTime.Day == 6)
|
|
)
|
|
{
|
|
var list = info.m_newUser.Where(o => o.Value.bLoseLess10000 == 0);
|
|
|
|
foreach(var data in list)
|
|
{
|
|
strMessage = string.Format("{0}/{1}/{2}\t{3}",
|
|
pair.Key.Year, pair.Key.Month, pair.Key.Day,
|
|
data.Value.Uid
|
|
);
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
}
|
|
}
|
|
}
|
|
|
|
fileWriter.Dispose();
|
|
fsFile.Dispose();
|
|
}
|
|
|
|
public static void PrintBrokenUserLost()
|
|
{
|
|
FileStream fsFile = new FileStream("./bill_out_brokenuserlost.txt", FileMode.Create);
|
|
|
|
|
|
StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8);
|
|
string strMessage = "Date\t活跃用户\t付费用户\t破产1次用户\t破产2次用户\t破产3次用户\t破产4次用户\t破产1次付费用户\t破产2次付费用户\t破产3次付费用户\t破产4次付费用户\t破产1次次日流失用户\t破产2次次日流失用户\t破产3次次日流失用户\t破产4次次日流失用户";
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
|
|
foreach (KeyValuePair<DateTime, BillInfoEveryDay> pair in BillAlldays.Instance.m_billAllDays)
|
|
{
|
|
DateTime dateTime = pair.Key;
|
|
BillInfoEveryDay info = pair.Value;
|
|
strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\t{13}\t{14}\t{15}\t{16}",
|
|
dateTime.Year, dateTime.Month, dateTime.Day,
|
|
info.ActiveUser,
|
|
info.m_PayGoogleSuccessResUser.Count
|
|
, info.GetBrokenGrandUserCount(1)
|
|
, info.GetBrokenGrandUserCount(2)
|
|
, info.GetBrokenGrandUserCount(3)
|
|
, info.GetBrokenGrandUserCount(4),
|
|
info.GetBrokenAndPayUserCount(1),
|
|
info.GetBrokenAndPayUserCount(2),
|
|
info.GetBrokenAndPayUserCount(3),
|
|
info.GetBrokenAndPayUserCount(4),
|
|
info.BrokenLostNextDayCount1,
|
|
info.BrokenLostNextDayCount2,
|
|
info.BrokenLostNextDayCount3,
|
|
info.BrokenLostNextDayCount4
|
|
);
|
|
|
|
|
|
fileWriter.WriteLine(strMessage);
|
|
|
|
}
|
|
|
|
fileWriter.Dispose();
|
|
fsFile.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|