Browse Source

上报处理数据

dev
巴林闲侠 2 years ago
parent
commit
9e51bbe72a
  1. 14
      api/app/lib/controllers/report/index.js
  2. 21
      api/app/lib/models/report.js
  3. 8
      scripts/1.2.3/schema/2.update_report.sql

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

@ -32,7 +32,6 @@ async function reportList (ctx) {
`
const res = await sequelize.query(sqlStr, { type: QueryTypes.SELECT })
let a = 1
findUsers = res.map(item => {
return item.id
})
@ -192,10 +191,15 @@ async function reportHandle (ctx) {
const { reportId } = ctx.params
const { handleState } = ctx.request.body
await models.Report.update({
handleState: handleState
}, {
const data = ctx.request.body
/**
* data = {
* handleState,
* handleContent,
* handlePic
* }
*/
await models.Report.update(data, {
where: {
id: reportId
}

21
api/app/lib/models/report.js

@ -204,8 +204,25 @@ module.exports = dc => {
primaryKey: false,
field: "performer_id",
autoIncrement: false
}
},
handleContent: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: "",
primaryKey: false,
field: "handle_content",
autoIncrement: false
},
handlePic: {
type: DataTypes.ARRAY(DataTypes.STRING),
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "handle_pic",
autoIncrement: false
},
}, {
tableName: "report",
comment: "",

8
scripts/1.2.3/schema/2.update_report.sql

@ -1,2 +1,6 @@
alter table report
add code_road varchar(512);
ALTER TABLE report add code_road varchar(512);
ALTER TABLE report add handle_content varchar(1024); comment
ON column report.handle_content is '执行内容描述';
ALTER TABLE report add handle_pic varchar(1204) [];
Loading…
Cancel
Save