逻辑修改

This commit is contained in:
wuhan 2024-04-18 16:08:13 +08:00
parent fcf91f0011
commit 9e3747d579
2 changed files with 3 additions and 15 deletions

View File

@ -250,7 +250,7 @@ export class ClientService {
totalResult.forEach((value, key) => { totalResult.forEach((value, key) => {
const dayNumList = []; const dayNumList = [];
// 循环生成最近七天日期 // 循环生成最近七天日期
for (let i = 0; i < 7; i++) { for (let i = 6; i >= 0; i--) {
const date = moment().subtract(i, 'days').format('YYYY-MM-DD'); const date = moment().subtract(i, 'days').format('YYYY-MM-DD');
const num = Math.floor(Math.random() * 30) + 1; const num = Math.floor(Math.random() * 30) + 1;
dayNumList.push({ dayNumList.push({
@ -265,7 +265,7 @@ export class ClientService {
icon: value.icon, icon: value.icon,
id: value.id, id: value.id,
liveNum: value.sum, liveNum: value.sum,
dayNumList: map.get(value.id).reverse() dayNumList: map.get(value.id)
}) })
} else { } else {
data.mpList.push({ data.mpList.push({
@ -273,7 +273,7 @@ export class ClientService {
icon: value.icon, icon: value.icon,
id: value.id, id: value.id,
liveNum: value.sum, liveNum: value.sum,
dayNumList: dayNumList.reverse() dayNumList: dayNumList
}) })
} }
}) })

View File

@ -7,7 +7,6 @@ const fs = require('fs');
// 获取项目运行环境 // 获取项目运行环境
export const getEnv = () => { export const getEnv = () => {
// console.log(process.env);
return process.env.RUNNING_ENV || 'prod'; return process.env.RUNNING_ENV || 'prod';
}; };
@ -22,15 +21,6 @@ export const getConfig = () => {
const yamlPath = path.join(process.cwd(), `./${environment}.yaml`); const yamlPath = path.join(process.cwd(), `./${environment}.yaml`);
const file = fs.readFileSync(yamlPath, 'utf8'); const file = fs.readFileSync(yamlPath, 'utf8');
let config = parse(file); let config = parse(file);
// if (process?.argv[2]?.length) {
// config = { ...config, HOST: process.argv[2] }
// }
// if (process?.argv[3]?.length) {
// config = { ...config, USER: process.argv[3] }
// }
// if (process?.argv[4]?.length) {
// config = { ...config, PASSWORD: process.argv[4] }
// }
// 融合注入参数 // 融合注入参数
config = Object.assign(config, process.env); config = Object.assign(config, process.env);
configAll = { ...config, isExist: true } configAll = { ...config, isExist: true }
@ -55,7 +45,5 @@ export const getMysql = () => {
// synchronize: false, // synchronize: false,
// logging: true, // logging: true,
} }
console.log(mysql);
return mysql return mysql
} }