public override OpRes doQuery(object param, GMUser user) { m_result.Clear(); m_cond.startQuery(); OpRes res = makeQuery(param, user, m_cond); if (res != OpRes.opres_success) return res; IMongoQuery imq = m_cond.getImq(); ParamQueryRecharge p = (ParamQueryRecharge)param; return query(p, imq, m_rbase, user); }
// 开始统计 public override OpRes doStat(object param, GMUser user) { ParamQueryRecharge p = (ParamQueryRecharge)param; QueryMgr mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery); m_cond.startQuery(); OpRes res = mgr.makeQuery(param, QueryType.queryTypeRecharge, user, m_cond); if (res != OpRes.opres_success) { return(res); } IMongoQuery imq = m_cond.getImq(); QueryDocument qd = (QueryDocument)imq; if (!qd.Contains("PayTime")) { return(OpRes.op_res_time_format_error); } m_result.Clear(); QueryRecharge rq = mgr.getQuery <QueryRecharge>(QueryType.queryTypeRecharge); int serverId = DBMgr.getInstance().getSpecialServerId(DbName.DB_PAYMENT); MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(rq.getPlatInfo().m_tableName, serverId, DbName.DB_PAYMENT, imq, MapReduceTable.getMap("sameOrderId"), MapReduceTable.getReduce("sameOrderId")); int count = 0; if (map_result != null) { IEnumerable <BsonDocument> bson = map_result.GetResults(); foreach (BsonDocument d in bson) { BsonValue resValue = d["value"]; count = resValue["total"].ToInt32(); if (count > 1) { ResultSameOrderIdItem tmp = new ResultSameOrderIdItem(); m_result.Add(tmp); tmp.m_count = count; tmp.m_orderId = Convert.ToString(d["_id"]); } } } return(OpRes.opres_success); }
public override OpRes doQuery(object param, GMUser user) { m_result.Clear(); m_cond.startQuery(); OpRes res = makeQuery(param, user, m_cond); if (res != OpRes.opres_success) { return(res); } IMongoQuery imq = m_cond.getImq(); ParamGameHistory p = (ParamGameHistory)param; return(query(p, imq, user)); }
public override OpRes doQuery(object param, GMUser user) { m_result.Clear(); m_cond.startQuery(); OpRes res = makeQuery(param, user, m_cond); if (res != OpRes.opres_success) { return(res); } IMongoQuery imq = m_cond.getImq(); ParamSearch p = (ParamSearch)param; return(query(p, imq, user, TableName.DAILY_ACCOUNT_CREATE, DbName.DB_ACCOUNT)); }
// 开始统计 public override OpRes doStat(object param, GMUser user) { m_result.Clear(); m_cond.startQuery(); OpRes res = makeQuery(param, user, m_cond); if (res != OpRes.opres_success) { return(res); } ParamQuery p = (ParamQuery)param; if (isSame(p, user)) { return(query(p, null, user)); } else { m_lastSearchTime = p.m_time; m_dbId = user.getDbServerID(); } IMongoQuery imqTime = m_cond.getImq(); MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(TableName.STAT_PLAYER_DRAGON, user.getDbServerID(), DbName.DB_PUMP, imqTime, MapReduceTable.getMap("playerDragonBall"), MapReduceTable.getReduce("playerDragonBall"), MapTable); if (map_result != null) { return(query(p, null, user)); } return(OpRes.opres_success); }
// 开始统计 public override OpRes doStat(object param, GMUser user) { ParamQueryRecharge p = (ParamQueryRecharge)param; QueryMgr mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery); m_cond.startQuery(); OpRes res = mgr.makeQuery(param, QueryType.queryTypeRecharge, user, m_cond); if (res != OpRes.opres_success) { return(res); } IMongoQuery imq = m_cond.getImq(); m_result.reset(); QueryRecharge rq = mgr.getQuery <QueryRecharge>(QueryType.queryTypeRecharge); int serverId = DBMgr.getInstance().getSpecialServerId(DbName.DB_PAYMENT); MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(rq.getPlatInfo().m_tableName, serverId, DbName.DB_PAYMENT, imq, MapReduceTable.getMap("recharge"), MapReduceTable.getReduce("recharge")); if (map_result != null) { IEnumerable <BsonDocument> bson = map_result.GetResults(); foreach (BsonDocument d in bson) { BsonValue resValue = d["value"]; m_result.m_total += resValue["total"].ToInt32(); m_result.m_rechargePersonNum++; m_result.m_rechargeCount += resValue["rechargeCount"].ToInt32(); } } return(OpRes.opres_success); }
// 开始统计 public override OpRes doStat(object param, GMUser user) { m_result.Clear(); m_cond.startQuery(); OpRes res = makeQuery(param, user, m_cond); if (res != OpRes.opres_success) { return(res); } ParamIncomeExpenses p = (ParamIncomeExpenses)param; if (isSame(p, user)) { return(query(p, null, user)); } else { m_lastParam.assign(p, user.getDbServerID()); } IMongoQuery imqTime = m_cond.getImq(); MapReduceResult map_result = DBMgr.getInstance().executeMapReduce(TableName.STAT_INCOME_EXPENSES, user.getDbServerID(), DbName.DB_PUMP, imqTime, MapReduceTable.getMap("playerIncomeExpenses"), MapReduceTable.getReduce("playerIncomeExpenses"), MapTable); if (map_result != null) { return(query(p, null, user)); } return(OpRes.opres_success); }
public override OpRes doQuery(object param, GMUser user) { m_result.Clear(); m_cond.startQuery(); OpRes res = makeQuery(param, user, m_cond); if (res != OpRes.opres_success) { return(res); } ParamScoreOpRecord p = (ParamScoreOpRecord)param; string cond = Convert.ToString(m_cond.getCond()["cond"]); string cmd = string.Format(SqlStrCMD.SQL_QUERY_SCORE_OP, TableName.GM_SCORE, TableName.GM_ACCOUNT, cond, (p.m_curPage - 1) * p.m_countEachPage, p.m_countEachPage); // 查看满足条件的记当个数 user.totalRecord = user.sqlDb.getRecordCountNoWhere(TableName.GM_SCORE + "," + TableName.GM_ACCOUNT, cond, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); List <Dictionary <string, object> > dataList = user.sqlDb.queryList(cmd, user.getMySqlServerID(), MySqlDbName.DB_XIANXIA); if (dataList == null) { return(OpRes.op_res_failed); } for (int i = 0; i < dataList.Count; i++) { ResultScoreOpRecordItem info = new ResultScoreOpRecordItem(); m_result.Add(info); Dictionary <string, object> data = dataList[i]; info.m_id = Convert.ToInt64(data["opId"]); info.m_opTime = Convert.ToDateTime(data["opTime"]).ToString(); info.m_opAcc = Convert.ToString(data["opSrc"]); info.m_opAccAlias = ""; info.m_opType = Convert.ToInt32(data["opType"]); info.m_opScore = Convert.ToInt64(data["opScore"]); info.m_dstAcc = Convert.ToString(data["opDst"]); // info.m_moneyType = Convert.ToInt32(data["moneyType"]); if (!(data["aliasName"] is DBNull)) { info.m_opAccAlias = Convert.ToString(data["aliasName"]); } if (!(data["opDstRemainMoney"] is DBNull)) { info.m_dstRemainMoney = Convert.ToInt64(data["opDstRemainMoney"]); } if (!(data["opRemainMoney"] is DBNull)) { info.m_opRemainMoney = Convert.ToInt64(data["opRemainMoney"]); } ////////////////////////////////////////////////////////////////////////// if (!(data["userOrderId"] is DBNull)) { info.m_apiOrder = Convert.ToString(data["userOrderId"]); } if (!(data["opResult"] is DBNull)) { info.m_opResult = Convert.ToInt32(data["opResult"]); } else { info.m_opResult = PlayerReqOrderState.STATE_FINISH; } if (!(data["failReason"] is DBNull)) { info.m_failReason = Convert.ToInt32(data["failReason"]); } if (!(data["logFrom"] is DBNull)) { info.m_logFrom = Convert.ToInt32(data["logFrom"]); } else { info.m_logFrom = OrderGenerator.ORDER_FROM_BG_OP; } if (!(data["finishTime"] is DBNull)) { info.m_finishTime = Convert.ToDateTime(data["finishTime"]).ToString(); } if (!(data["orderId"] is DBNull)) { info.m_orderId = Convert.ToString(data["orderId"]); } } return(OpRes.opres_success); }