|
|
@@ -49,6 +49,7 @@ const GAMES = {
|
|
|
Baselist: {},
|
|
|
Relations: {},
|
|
|
Solutions: {},
|
|
|
+ ObOriginalData: {},
|
|
|
UpdateTimestamp: {},
|
|
|
};
|
|
|
|
|
|
@@ -126,12 +127,6 @@ const updateLeaguesList = ({ mk, leagues, platform='ps' }) => {
|
|
|
|
|
|
const { Leagues } = GAMES;
|
|
|
|
|
|
- Object.keys(Leagues).forEach(platform => {
|
|
|
- if (!['ps', 'ob', 'hg'].includes(platform)) {
|
|
|
- delete Leagues[platform];
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
if (!Leagues[platform]) {
|
|
|
Leagues[platform] = {};
|
|
|
}
|
|
|
@@ -175,6 +170,23 @@ const getFilteredLeagues = async (mk) => {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * 更新OB原始数据
|
|
|
+ */
|
|
|
+const updateOriginalData = ({ leagues, matches }) => {
|
|
|
+ const { ObOriginalData } = GAMES;
|
|
|
+ ObOriginalData.leagues = leagues;
|
|
|
+ ObOriginalData.matches = matches;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取OB原始数据
|
|
|
+ */
|
|
|
+const getOriginalData = () => {
|
|
|
+ const { ObOriginalData } = GAMES;
|
|
|
+ return ObOriginalData;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* 同步比赛列表到服务器
|
|
|
*/
|
|
|
@@ -746,18 +758,6 @@ const updateGamesResult = (result) => {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * 获取OB联赛列表
|
|
|
- */
|
|
|
-const getObLeaguesList = async() => {
|
|
|
- const { Leagues } = GAMES;
|
|
|
- const { ob } = Leagues;
|
|
|
- if (!ob) {
|
|
|
- return Promise.reject(new Error('ob leagues list not found'));
|
|
|
- }
|
|
|
- return Promise.resolve(Object.values(ob)[0]);
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* 同步中单方案
|
|
|
*/
|
|
|
@@ -1310,7 +1310,7 @@ module.exports = {
|
|
|
updateGamesList, updateGamesEvents,
|
|
|
getGamesRelation,
|
|
|
updateGamesResult,
|
|
|
- getObLeaguesList,
|
|
|
+ updateOriginalData, getOriginalData,
|
|
|
getSolutions, getGamesSolutions, getSolution, getSolutionsByIds,
|
|
|
getTotalProfitWithSid,
|
|
|
getTotalProfitWithBetInfo,
|