修复分类筛选,新增个人信息修改接口,区分不同客户端
This commit is contained in:
@@ -5,7 +5,7 @@ const router = express.Router();
|
||||
|
||||
router.get('/', async (req, res) => {
|
||||
try {
|
||||
const { page = 1, limit = 10, search = '' } = req.query;
|
||||
const { page = 1, limit = 10, search = '', user_id } = req.query;
|
||||
|
||||
// 确保参数为有效数字
|
||||
const pageNum = Math.max(1, parseInt(page) || 1);
|
||||
@@ -21,6 +21,11 @@ router.get('/', async (req, res) => {
|
||||
whereClause += ' AND amount LIKE ?';
|
||||
params.push(`%${search}%`);
|
||||
}
|
||||
|
||||
if (user_id) {
|
||||
whereClause += ' AND user_id = ?';
|
||||
params.push(user_id);
|
||||
}
|
||||
|
||||
// 获取总数
|
||||
const countQuery = `SELECT COUNT(*) as total FROM withdrawal ${whereClause}`;
|
||||
|
||||
Reference in New Issue
Block a user