Exemple #1
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        ParamStatPlayer p = (ParamStatPlayer)param;
        DateTime        mint = DateTime.Now, maxt = mint;
        bool            res = Tool.splitTimeStr(p.m_time, ref mint, ref maxt);

        if (!res)
        {
            return(OpRes.op_res_time_format_error);
        }

        m_result.reset();

        string   cmd = "";
        statData fun = null;

        switch (p.m_statType)
        {
        case (int)StatSellerType.stat_seller_type_day:
        {
            // 售货亭对下级管理员的存款及提款
            cmd = string.Format(CMD_STAT_PLAYER, "%Y-%m-%d",
                                TableName.PLAYER_GAME_SCORE,
                                TableName.PLAYER_ACCOUNT_XIANXIA,
                                mint,
                                maxt,
                                p.m_moneyType);

            fun = doStatTypeDay;
        }
        break;

        case (int)StatSellerType.stat_seller_type_month:
        {
            cmd = string.Format(CMD_STAT_PLAYER, "%Y-%m",
                                TableName.PLAYER_GAME_SCORE,
                                TableName.PLAYER_ACCOUNT_XIANXIA,
                                mint,
                                maxt,
                                p.m_moneyType);

            fun = doStatTypeDay;
        }
        break;
        }

        List <Dictionary <string, object> > dataList
            = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA);

        if (fun != null)
        {
            fun(dataList);
        }

        return(OpRes.opres_success);
    }
Exemple #2
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        ParamStatSeller p    = (ParamStatSeller)param;
        string          cond = "";
        OpRes           res  = m_generator.genSearchSql(p, user, ref cond);

        if (res != OpRes.opres_success)
        {
            return(res);
        }

        m_result.reset();

        string   cmd = "";
        statData fun = null;

        switch (p.m_statType)
        {
        case (int)StatSellerType.stat_seller_type_day:
        {
            // 售货亭对下级管理员的存款及提款
            // cmd = string.Format(SqlStrCMD.STR_FTM1, "%Y-%m-%d",
            //     TableName.PLAYER_SCORE,
            //    cond);

            fun = doStatTypeDay;
        }
        break;

        case (int)StatSellerType.stat_seller_type_month:
        {
            // 售货亭对下级管理员的存款及提款
            //  cmd = string.Format(SqlStrCMD.STR_FTM1, "%Y-%m",
            //     TableName.PLAYER_SCORE,
            //    cond);

            fun = doStatTypeDay;
        }
        break;
        }

        List <Dictionary <string, object> > dataList
            = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA);

        if (fun != null)
        {
            fun(dataList);
        }

        return(OpRes.opres_success);
    }