Commit 3c82d295 by chenjinjing

no message

parent f2ac902f
import { info } from "console";
import { get选手详细分析 } from "../data/analysisData";
import { getBaseData, get单前比赛对局时间节点, get右侧数据, get图表, get散点图, get比赛详情, get近期比赛概览 } from "../data/xsxxfxData";
import { getBaseData, get全部比赛日期, get单前比赛对局时间节点, get右侧数据, get图表, get散点图, get比赛详情, get近期比赛概览 } from "../data/xsxxfxData";
import { getChartData, objKeyReplace, getKeyValue, getSingleYAndMoreData, getListData, getMoreYChartData, getKeyStringValue } from "../util/tools";
export async function getData(req, res) {
......@@ -37,6 +37,8 @@ export async function getData(req, res) {
ret["point"] = await 比赛时间节点(mid);
ret["allmatchtime"] = await get全部比赛日期();
res.send(ret);
}
......@@ -174,4 +176,4 @@ async function 右侧数据(mid, selfName, opponentName) {
opponentHeat.push({key:opponentName, value:info.value});
});
return {attackData, defenceData, selfHeat, opponentHeat};
}
\ No newline at end of file
}
......@@ -44,7 +44,7 @@ export async function getData(req, res) {
ret["api7"] = getChartData("月训练量趋势", countMap, false, false );
let 最新一条数据 = await get最近一条淘汰赛时间();
let data = await get积分赛淘汰赛数据(最新一条数据.time || new Date(), 0 );
let data = await get积分赛淘汰赛数据(最新一条数据.time || new Date());
let dataName = 最新一条数据.type == 1 ? "淘汰赛" : "校内积分赛";
ret["matchlist"] = getListData(dataName, data, ["排名","照片","学员","场次","胜场","负场","积分"], {"排名":"rank","照片":"self_pic","学员":"p_name","场次":"gameCount","胜场":"win","负场":"lose","积分":"points"} );
......@@ -56,10 +56,10 @@ export async function getData(req, res) {
//淘汰赛积分赛接口
export async function getCompetition(req, res) {
let { time, type } = req.query;
let data = await get积分赛淘汰赛数据(time, type);
let { time } = req.query;
let data = await get积分赛淘汰赛数据(time);
let ret:any = {};
let dataName = type == 1 ? "淘汰赛" : "校内积分赛";
ret["matchlist"] = getListData(dataName, data, ["排名","学员","场次","胜场","负场","积分"], {"排名":"RANK","学员":"P_NAME","场次":"GAMECOUNT","胜场":"WIN","负场":"LOSE","积分":"POINTS"} );
let dataName = "校内积分赛";
ret["matchlist"] = getListData(dataName, data, ["排名","照片","学员","场次","胜场","负场","积分"], {"排名":"rank","照片":"self_pic","学员":"p_name","场次":"gameCount","胜场":"win","负场":"lose","积分":"points"} );
res.send(ret);
}
......@@ -65,6 +65,17 @@ export async function get近期比赛概览(PID, checkDate) {
return {dataList:result, firstDate};
}
export async function get全部比赛日期() {
let sql = "select to_char(m_date,'yyyy/mm/dd') m_time from recent_match group by m_date";
let selectResult = await selectData(sql); // [{to_char:'日期'},...]
let result = [];
selectResult.forEach(info => {
result.push(info.M_TIME);
});
return result;// ["", "", "日期2.."]
}
function dataFormat(time) {
let date = new Date(time);
let match = date.getMonth() + 1;
......
......@@ -98,9 +98,9 @@ export async function get最近一条淘汰赛时间() {
return {time:result["G_MONTH"], type:result["G_TYPE"]};
}
export async function get积分赛淘汰赛数据(time, type) {
let sql = 'select * from points_competition where g_month = Placeholder1 and g_type = Placeholder2 and ROWNUM < 10 order by rank';
let selectResult = await selectData(sql, time, type);
export async function get积分赛淘汰赛数据(time) {
let sql = 'select * from points_competition where g_month = Placeholder1 and ROWNUM < 10 order by rank';
let selectResult = await selectData(sql, time);
let list = [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment