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 LogPayInfo() { FileStream fsFile = new FileStream("./bill_out_pay.txt", FileMode.Create); StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8); string strMessage = "Date\t支付次数\t支付用户\t当天首次付费用户\t付费金额(USD)\t付费渗透率\tARPPU\tARPU\t月付费金额\t鱼虾蟹付费用户\t鱼虾蟹用户付费\t鱼虾蟹付费渗透率\t"; strMessage += "gp_chip1购买次数\tgp_chip2购买次数\tgp_chip3购买次数\tgp_chip4购买次数\tgp_chip5购买次数\tgp_chip6购买次数\t"+ "gp_bag1购买次数\tgp_bag2购买次数\tgp_bag3购买次数\tgp_bag4购买次数\t"+ "gp_diamond1购买次数\tgp_diamond2购买次数\tgp_diamond3购买次数\tgp_diamond4购买次数\tgp_diamond5购买次数\tgp_diamond6购买次数\t"; strMessage += "gp_chip1购买人数\tgp_chip2购买人数\tgp_chip3购买人数\tgp_chip4购买人数\tgp_chip5购买人数\tgp_chip6购买人数\t"+ "gp_bag1购买人数\tgp_bag2购买次数\tgp_bag3购买次数\tgp_bag4购买次数\t"+ "gp_diamond1购买人数\tgp_diamond2购买人数\tgp_diamond3购买人数\tgp_diamond4购买人数\tgp_diamond5购买人数\tgp_diamond6购买人数"; fileWriter.WriteLine(strMessage); foreach (KeyValuePair pair in BillAlldays.Instance.m_billAllDays) { DateTime dateTime = pair.Key; BillInfoEveryDay info = pair.Value; string strPayComm = string.Format( "{0}/{1}/{2}\t{3}\t{4}\t{5}\t{6:0.0}\t{7:0.0000}%\t{8:0.0}\t{9:0.000}\t{10:0.0}" , dateTime.Year, dateTime.Month, dateTime.Day , info.PayCount , info.m_PayGoogleSuccessResUser.Count() , info.FirstPay , info.MoneyUSD , info.PayUserPer , info.ARPPU , info.ARPU , info.MoneyUSDMon); string strPayGoogleCount = string.Format("{0}\t{1}\t{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}" , info.GetPayGoogleCount("gp_chip1") , info.GetPayGoogleCount("gp_chip2") , info.GetPayGoogleCount("gp_chip3") , info.GetPayGoogleCount("gp_chip4") , info.GetPayGoogleCount("gp_chip5") , info.GetPayGoogleCount("gp_chip6") , info.GetPayGoogleCount("gp_bag1") , info.GetPayGoogleCount("gp_bag2") , info.GetPayGoogleCount("gp_bag3") , info.GetPayGoogleCount("gp_bag4") //, info.m_PayGoogleSuccessResUser , info.GetPayGoogleCount("gp_dimond1") , info.GetPayGoogleCount("gp_dimond2") , info.GetPayGoogleCount("gp_dimond3") , info.GetPayGoogleCount("gp_dimond4") , info.GetPayGoogleCount("gp_dimond5") , info.GetPayGoogleCount("gp_dimond6") ); string strPayGoogleUserCount = string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}{10}\t{11}\t{12}\t{13}\t{14}\t{15}" , info.GetPayGoogleUserCount("gp_chip1") , info.GetPayGoogleUserCount("gp_chip2") , info.GetPayGoogleUserCount("gp_chip3") , info.GetPayGoogleUserCount("gp_chip4") , info.GetPayGoogleUserCount("gp_chip5") , info.GetPayGoogleUserCount("gp_chip6") , info.GetPayGoogleUserCount("gp_bag1") , info.GetPayGoogleUserCount("gp_bag2") , info.GetPayGoogleUserCount("gp_bag3") , info.GetPayGoogleUserCount("gp_bag4") , info.GetPayGoogleUserCount("gp_dimond1") , info.GetPayGoogleUserCount("gp_dimond2") , info.GetPayGoogleUserCount("gp_dimond3") , info.GetPayGoogleUserCount("gp_dimond4") , info.GetPayGoogleUserCount("gp_dimond5") , info.GetPayGoogleUserCount("gp_dimond6") ); //strMessage = strPayComm + strPayGoogleCount + strPayGoogleUserCount; strMessage = string.Format("{0}\t{1}\t{2}", strPayComm, strPayGoogleCount, strPayGoogleUserCount); fileWriter.WriteLine(strMessage); } fileWriter.Dispose(); fsFile.Dispose(); } } }