修复异常
This commit is contained in:
@@ -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