protected void onQuery(string creator, int detailType, GMUser user)
        {
            m_levelStr.InnerHtml = user.getOpLevelMgr().getCurLevelStr(creator);

            ParamWinLose param = new ParamWinLose();

            param.m_creator    = creator == "" ? ItemHelp.getAccountSpecial(user) : creator;
            param.m_detailType = detailType;
            param.m_time       = m_time.Text;
            param.m_playerAcc  = m_acc.Text;

            if (creator == "")
            {
                param.m_creatorIsSubAcc = ItemHelp.isSubAcc(user);
            }

            OpRes res = user.doStat(param, StatType.statTypeWinLose);

            if (param.isStatOnePlayer())
            {
                ViewPlayerWinLose v = new ViewPlayerWinLose();
                v.genTable(m_result, res, user);
            }
            else
            {
                genTableSumResult(m_result, res, user, param);
                if (res == OpRes.opres_success)
                {
                    if (param.isDetailSubAgent())
                    {
                        genTableDetailResult(m_detailResult, res, user, param, s_head);
                        m_info.InnerText = string.Format("{0}的直属下线", creator);
                    }
                    else
                    {
                        genTableDetailResult(m_detailResult, res, user, param, s_head1);
                        m_info.InnerText = string.Format("{0}的直属会员", creator);
                    }
                }
            }
        }
        public void genTableDetailResult(Table table, OpRes res, GMUser user, ParamWinLose param,
                                         string[] head)
        {
            TableRow tr = new TableRow();

            table.Rows.Add(tr);
            TableCell td = null;

            if (res != OpRes.opres_success)
            {
                td = new TableCell();
                tr.Cells.Add(td);
                td.Text = OpResMgr.getInstance().getResultString(res);
                return;
            }

            int i = 0;

            // 表头
            for (i = 0; i < head.Length; i++)
            {
                td = new TableCell();
                tr.Cells.Add(td);
                td.Text = s_head[i];
            }

            URLParam uparam = new URLParam();

            uparam.m_url       = DefCC.ASPX_WIN_LOSE;
            uparam.m_text      = "明细";
            uparam.m_key       = "acc";
            uparam.m_className = "cLevelLink";
            StatResultWinLose qresult = (StatResultWinLose)user.getStatResult(StatType.statTypeWinLose);

            m_sum.reset();
            for (i = 0; i < qresult.m_detail.Count; i++)
            {
                tr = new TableRow();
                table.Rows.Add(tr);
                if ((i & 1) == 0)
                {
                    tr.CssClass = "alt";
                }

                StatResultWinLoseItem item = qresult.m_detail[i];
                uparam.m_value = item.m_acc;
                if (param.isDetailSubAgent())
                {
                    uparam.clearExParam(); uparam.addExParam("detail", param.m_detailType);
                    uparam.addExParam("time", param.m_time.TrimStart(' ').TrimEnd(' '));
                    m_content[0] = Tool.genHyperlink(uparam);
                }
                else
                {
                    m_content[0] = "";
                }

                m_content[1] = StrName.s_accountType[item.m_accType];                                 // 级别,账号类型
                m_content[2] = item.m_acc;                                                            // 账号
                m_content[3] = ItemHelp.toStrByComma(ItemHelp.showMoneyValue(item.m_totalOutlay));    // 总押注
                m_content[4] = ItemHelp.toStrByComma(ItemHelp.showMoneyValue(item.m_totalIncome));    // 总返还
                m_content[5] = ItemHelp.toStrByComma(item.getWinLoseMoney());                         // 总盈利
                m_content[6] = ItemHelp.toStrByComma(ItemHelp.showMoneyValue(item.m_totalWashCount)); // 洗码量

                if (param.isDetailSubAgent())
                {
                    m_content[7]  = item.getWashRatio().ToString();                          // 洗码比
                    m_content[8]  = ItemHelp.toStrByComma(item.getWashCommission());         // 洗码佣金
                    m_content[9]  = ItemHelp.toStrByComma(item.getTotalMoney());             // 总金额
                    m_content[10] = item.getAgentRatio().ToString();                         // 代理占成
                    m_content[11] = ItemHelp.toStrByComma(item.getAgentHandInCompany());     // 代理交公司
                    m_content[12] = ItemHelp.toStrByComma(item.getOutlayHandInCompany());    // 交公司投注
                    m_content[13] = ItemHelp.toStrByComma(item.getWashCountHandInCompany()); // 交公司洗码量
                    m_content[14] = item.getCompanyProfitRatioStr();                         // 公司获利比
                }
                else
                {
                    m_content[7] = item.getWashRatio().ToString();                  // 洗码比
                    m_content[8] = ItemHelp.toStrByComma(item.getWashCommission()); // 洗码佣金
                    m_content[9] = ItemHelp.toStrByComma(item.getTotalMoney());     // 总金额
                }

                for (int k = 0; k < head.Length; k++)
                {
                    td = new TableCell();
                    tr.Cells.Add(td);
                    td.Text = m_content[k];

                    if (k == 14)
                    {
                        setColor(td, td.Text);
                    }
                }

                m_sum.m_item.m_totalIncome    += item.m_totalIncome;
                m_sum.m_item.m_totalOutlay    += item.m_totalOutlay;
                m_sum.m_item.m_totalWashCount += item.m_totalWashCount;

                m_sum.m_washCommission         += item.getWashCommission();
                m_sum.m_totalMoney             += item.getTotalMoney();
                m_sum.m_agentHandInCompany     += item.getAgentHandInCompany();
                m_sum.m_outlayHandInCompany    += item.getOutlayHandInCompany();
                m_sum.m_washCountHandInCompany += item.getWashCountHandInCompany();
            }

            addFootSum(table, param.isDetailSubAgent());
        }
Example #3
0
    // 开始统计
    public override OpRes doStat(object param, GMUser user)
    {
        m_result.reset();
        OpRes        res = OpRes.op_res_param_not_valid;
        ParamWinLose p   = (ParamWinLose)param;

        bool canEmpty = m_generator.timeCanEmpty();

        if (!canEmpty)
        {
            if (string.IsNullOrEmpty(p.m_time))
            {
                return(OpRes.op_res_time_format_error);
            }
        }

        if (p.isStatOnePlayer())
        {
            statOnePlayer(user, p);
            return(OpRes.opres_success);
        }

        ParamMemberInfo paramInfo = new ParamMemberInfo();

        paramInfo.m_creator     = p.m_creator;
        paramInfo.m_searchDepth = 1;

        if (p.isDetailSubAgent()) // 详细列表中列的是子代理
        {
            // 搜索指定创建者的所有直属下线
            res = user.doQuery(paramInfo, QueryType.queryTypeGmAccount);
            if (res != OpRes.opres_success)
            {
                return(res);
            }

            List <MemberInfo> qresult = (List <MemberInfo>)user.getQueryResult(QueryType.queryTypeGmAccount);
            for (int i = 0; i < qresult.Count; i++)
            {
                MemberInfo minfo = qresult[i];
                // user.getOpLevelMgr().addSub(p.m_creator, minfo.m_acc);
                addSubLevel(user, p.m_creator, minfo.m_acc, p);

                res = statSubAgent(minfo, p.m_time, user);
                if (res != OpRes.opres_success)
                {
                    return(res);
                }
            }

            res = statDirectlyPlayerSum(p.m_creator, p.m_time, user);
        }
        else // 详细列表中列的是直属玩家
        {
            // 搜索指定创建者的所有直属下线
            res = user.doQuery(paramInfo, QueryType.queryTypePlayerMember);
            if (res != OpRes.opres_success)
            {
                return(res);
            }

            List <MemberInfo> qresult = (List <MemberInfo>)user.getQueryResult(QueryType.queryTypePlayerMember);
            for (int i = 0; i < qresult.Count; i++)
            {
                MemberInfo minfo = qresult[i];
                res = statDirectlyPlayer(minfo, p.m_time, user);
                if (res != OpRes.opres_success)
                {
                    return(res);
                }
            }

            res = statSubAgentSum(p.m_creator, p.m_time, user);
        }

        m_result.finish(p, user);
        return(res);
    }