|
|
@ -1,7 +1,7 @@ |
|
|
|
'use strict'; |
|
|
|
const { QueryTypes } = require('sequelize'); |
|
|
|
|
|
|
|
async function reportList (ctx) { |
|
|
|
async function reportList(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { limit, page, startTime, endTime, keyword, userId, reportType, isTop, asc, projectType, handleState = '', performerId = '' } = ctx.query |
|
|
@ -48,7 +48,9 @@ async function reportList (ctx) { |
|
|
|
model: models.User, |
|
|
|
attributes: ['name'] |
|
|
|
}], |
|
|
|
order: [['time', asc ? 'ASC' : 'DESC']], |
|
|
|
//order: [['time', asc ? 'ASC' : 'DESC']],
|
|
|
|
order: [['time', 'DESC']], |
|
|
|
|
|
|
|
} |
|
|
|
if (limit) { |
|
|
|
findOption.limit = limit |
|
|
@ -114,7 +116,7 @@ async function reportList (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function reportPosition (ctx) { |
|
|
|
async function reportPosition(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { startTime, endTime, userId, reportType } = ctx.query |
|
|
@ -164,7 +166,7 @@ async function reportPosition (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function reportDetail (ctx) { |
|
|
|
async function reportDetail(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { reportId } = ctx.params |
|
|
@ -186,7 +188,7 @@ async function reportDetail (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function reportHandle (ctx) { |
|
|
|
async function reportHandle(ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
|
|
|
|
@ -216,7 +218,7 @@ async function reportHandle (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function createReport (ctx) { |
|
|
|
async function createReport(ctx) { |
|
|
|
try { |
|
|
|
const { userId } = ctx.fs.api |
|
|
|
const models = ctx.fs.dc.models; |
|
|
@ -238,7 +240,7 @@ async function createReport (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function deleteReport (ctx) { |
|
|
|
async function deleteReport(ctx) { |
|
|
|
try { |
|
|
|
const models = ctx.fs.dc.models; |
|
|
|
const { reportId } = ctx.params; |
|
|
|