Browse Source

小程序-巡查养护列表建议按照上报时间降序展示

dev
巴林闲侠 2 years ago
parent
commit
a1dbd74f50
  1. 11
      api/app/lib/controllers/report/index.js

11
api/app/lib/controllers/report/index.js

@ -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 } = ctx.query
@ -14,6 +14,7 @@ async function reportList(ctx) {
model: models.User,
attributes: ['name']
}],
order: [['time', 'DESC']],
}
if (limit) {
findOption.limit = limit
@ -60,7 +61,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
@ -110,7 +111,7 @@ async function reportPosition(ctx) {
}
}
async function reportDetail(ctx) {
async function reportDetail (ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params
@ -132,7 +133,7 @@ async function reportDetail(ctx) {
}
}
async function createReport(ctx) {
async function createReport (ctx) {
try {
const { userId } = ctx.fs.api
const models = ctx.fs.dc.models;
@ -154,7 +155,7 @@ async function createReport(ctx) {
}
}
async function deleteReport(ctx) {
async function deleteReport (ctx) {
try {
const models = ctx.fs.dc.models;
const { reportId } = ctx.params;

Loading…
Cancel
Save