Browse Source

fix 小程序-后台标记为管理员的用户登录小程序异常反馈看不到部门其他人上报的记录

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

14
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, asc, projectType, handleState = '', performerId = '' } = ctx.query
@ -20,7 +20,7 @@ async function reportList(ctx) {
WITH RECURSIVE sub_departments AS (
SELECT id, dependence
FROM department
WHERE id = 1
WHERE id = ${userInfo.departmentId}
UNION ALL
SELECT d.id, d.dependence
FROM sub_departments sd
@ -114,7 +114,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 +164,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 +186,7 @@ async function reportDetail(ctx) {
}
}
async function reportHandle(ctx) {
async function reportHandle (ctx) {
try {
const { models } = ctx.fs.dc;
@ -216,7 +216,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 +238,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