假设拿到的参数对象叫params
for (const propName in params) {
if (params[propName] === null || params[propName] === undefined || params[propName] === '') {
delete params[propName];
}
}
const res = await app.mysql.select('exam', {
where: params,
limit, // 返回数据量
offset: offset * limit, // 数据偏移量
});