Ejemplo n.º 1
0
    private bool statChannel(ChannelInfo info)
    {
        if (!StatBase.canStat(info))
        {
            return(false);
        }

        ParamStat param = new ParamStat();

        param.m_channel = info;

        StatResult result = new StatResult();

        foreach (var stat in m_statModule.Values)
        {
            stat.doStat(param, result);
        }

        Dictionary <string, object> newData = new Dictionary <string, object>();

        newData.Add("genTime", info.m_statDay.Date.AddDays(-1));
        newData.Add("channel", info.m_channelNum);

        newData.Add("regeditCount", result.m_regeditCount);
        newData.Add("deviceActivationCount", result.m_deviceActivationCount);
        newData.Add("activeCount", result.m_activeCount);

        newData.Add("totalIncome", result.m_totalIncome);
        newData.Add("rechargePersonNum", result.m_rechargePersonNum);
        newData.Add("rechargeCount", result.m_rechargeCount);

        // newData.Add("2DayRegeditCount", result.m_2DayRegeditCount);
        newData.Add("2DayRemainCount", result.m_2DayRemainCount);

        // newData.Add("3DayRegeditCount", result.m_3DayRegeditCount);
        newData.Add("3DayRemainCount", result.m_3DayRemainCount);

        // newData.Add("7DayRegeditCount", result.m_7DayRegeditCount);
        newData.Add("7DayRemainCount", result.m_7DayRemainCount);

        //newData.Add("30DayRegeditCount", result.m_30DayRegeditCount);
        newData.Add("30DayRemainCount", result.m_30DayRemainCount);

        IMongoQuery imq1 = Query.EQ("genTime", BsonValue.Create(info.m_statDay.Date.AddDays(-1)));
        IMongoQuery imq2 = Query.EQ("channel", BsonValue.Create(info.m_channelNum));
        IMongoQuery imq  = Query.And(imq1, imq2);

        updateRemain(info, 1, result);
        updateRemain(info, 3, result);
        updateRemain(info, 7, result);
        updateRemain(info, 30, result);

        string str = MongodbAccount.Instance.ExecuteStoreByQuery(TableName.CHANNEL_TD, imq, newData);

        return(str == string.Empty);
    }
Ejemplo n.º 2
0
    private bool statChannel(ChannelInfo info)
    {
        if (!StatBase.canStat(info))
        {
            return(false);
        }

        beginStat("渠道[{0}]开始统计", info.m_channelName);

        ParamStat param = new ParamStat();

        param.m_channel = info;

        StatResult result = new StatResult();

        foreach (var stat in m_statModule.Values)
        {
            stat.doStat(param, result);
        }

        IMongoQuery imq = null;
        Dictionary <string, object> newData = getData(result, info, ref imq);

        foreach (var d in s_remain)
        {
            updateRemain(info, d, result);
            updateDevRemain(info, d, result);
        }
        foreach (var d in s_totalRecharge)
        {
            updateTotalRecharge(info, d, result);
        }

        string str = MongodbAccount.Instance.ExecuteStoreByQuery(TableName.CHANNEL_TD, imq, newData);

        endStat("渠道[{0}]结束统计", info.m_channelName);
        return(str == string.Empty);
    }