| Total Complexity | 3 |
| Complexity/F | 1 |
| Lines of Code | 31 |
| Function Count | 3 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | const DB = require('../../libraries/db') |
||
| 2 | const ModelBase = require('../../model/base') |
||
| 3 | |||
| 4 | const table = 'mist_audit' |
||
| 5 | |||
| 6 | module.exports = { |
||
| 7 | add: async function (data) { |
||
| 8 | let res = await ModelBase.execInsert(table, data) |
||
| 9 | return res; |
||
| 10 | }, |
||
| 11 | |||
| 12 | first: async function (id) { |
||
| 13 | |||
| 14 | let result = await DB.readMysql.first( |
||
| 15 | '*' |
||
| 16 | ) |
||
| 17 | .from(table) |
||
| 18 | .where('audit_id', id) |
||
| 19 | .where('status', 1) |
||
| 20 | |||
| 21 | return result |
||
| 22 | |||
| 23 | }, |
||
| 24 | |||
| 25 | edit: async function (data, where, notWhere = {}) { |
||
| 26 | let result = await ModelBase.execUpdate(table, data, where, notWhere) |
||
| 27 | |||
| 28 | return result |
||
| 29 | } |
||
| 30 | |||
| 31 | } |