修复异常
This commit is contained in:
@@ -3,10 +3,10 @@ module.exports = {
|
||||
action: "/node/custom/list",
|
||||
method: "post",
|
||||
execute: (request, response) => {
|
||||
let {size, current, name} = request.query
|
||||
let {size, current, name, type} = request.query
|
||||
dbUtils.list({
|
||||
table: 'node_custom_config', con: name,
|
||||
search: {size, current}
|
||||
search: {size, current, type}
|
||||
}).then(data => {
|
||||
response.send({code: 0, data})
|
||||
}).catch(err => {
|
||||
|
||||
@@ -25,7 +25,7 @@ module.exports = {
|
||||
this.pool = mysql.createPool(dbConfig)
|
||||
},
|
||||
query,
|
||||
list: ({table, search, con}) => {
|
||||
list: ({table, search, con = ''}) => {
|
||||
//列表查询
|
||||
let total = 0, records = []
|
||||
if (table) {
|
||||
@@ -37,7 +37,7 @@ module.exports = {
|
||||
query(`select 1 from ${table} where name like '%${con}%' ${sqlCon}`).then(res => {
|
||||
return total = res.length
|
||||
}),
|
||||
query(`select * from ${table} where name like '%${con}%' ${sqlCon} limit ${(current-1)*size},${size||10}`).then(res => {
|
||||
query(`select * from ${table} where name like '%${con}%' ${sqlCon} limit ${((current-1)||0)*size},${size||10}`).then(res => {
|
||||
return records = res
|
||||
})
|
||||
]).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user