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 LogNewUserRechargeInfo() { FileStream fsFile = new FileStream("./bill_out_NewUserRecharge.txt", FileMode.Create); StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8); string strMessage = "Date\t新用户\t首日充值\t首日人数\t次日充值\t次日人数\t3日充值\t3日人数\t7日充值\t7日人数\t14日充值\t14日人数\t30日充值\t30日人数\t60日充值\t60日人数\t90日充值\t90日人数\t120日充值\t120日人数\t150日充值\t150日人数\t180日充值\t180日人数"; fileWriter.WriteLine(strMessage); foreach (KeyValuePair pair in BillAlldays.Instance.m_billAllDays) { DateTime dateTime = pair.Key; BillInfoEveryDay info = pair.Value; strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4:0.00}\t{5}\t{6:0.00}\t{7}\t{8:0.00}\t{9}\t{10:0.00}\t{11}\t{12:0.00}\t{13}\t{14:0.00}\t{15}\t{16:0.00}\t{17}\t{18:0.00}\t{19}\t{20:0.00}\t{21}\t{22:0.00}\t{23}\t{24:0.00}\t{25}" , dateTime.Year, dateTime.Month, dateTime.Day , info.m_newUser.Count , info.m_newUserRechargeMoney1 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount1 , info.m_newUserRechargeMoney2 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount2 , info.m_newUserRechargeMoney3 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount3 , info.m_newUserRechargeMoney7 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount7 , info.m_newUserRechargeMoney14 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount14 , info.m_newUserRechargeMoney30 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount30 , info.m_newUserRechargeMoney60 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount60 , info.m_newUserRechargeMoney90 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount90 , info.m_newUserRechargeMoney120 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount120 , info.m_newUserRechargeMoney150 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount150 , info.m_newUserRechargeMoney180 / BillTypeUtils.USD_TK_DOLLA , info.m_newUserRechargeCount180 ); fileWriter.WriteLine(strMessage); } fileWriter.Dispose(); fsFile.Dispose(); } public static void LogNewUserGetBrokeGrantInfo() { FileStream fsFile = new FileStream("./bill_out_NewUserBrokeGrantInfo.txt", FileMode.Create); StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8); string strMessage = "Date\tuid\t帐号类型\t领取1次玩牌\t领取2次玩牌\t领取3次玩牌\t领取4次玩牌\t领取5次玩牌\t领取6次玩牌"; fileWriter.WriteLine(strMessage); foreach (KeyValuePair pair in BillAlldays.Instance.m_billAllDays) { DateTime dateTime = pair.Key; BillInfoEveryDay info = pair.Value; TimeSpan ts = DateTime.Now - dateTime; int daysGap = (int)ts.TotalDays; foreach (var userInfo in info.m_newUser.Values) { if (userInfo.getBrokeGrantPlayGameCount != null && userInfo.getBrokeGrantPlayGameCount[0] > 0) { strMessage = string.Format("{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}" , dateTime.Year, dateTime.Month, dateTime.Day , userInfo.Uid , userInfo.AccType , userInfo.getBrokeGrantPlayGameCount[0] , userInfo.getBrokeGrantPlayGameCount[1] , userInfo.getBrokeGrantPlayGameCount[2] , userInfo.getBrokeGrantPlayGameCount[3] , userInfo.getBrokeGrantPlayGameCount[4] , userInfo.getBrokeGrantPlayGameCount[5] ); fileWriter.WriteLine(strMessage); } } } fileWriter.Dispose(); fsFile.Dispose(); } } }