修复分类筛选,新增个人信息修改接口,区分不同客户端

This commit is contained in:
dzl
2025-10-20 17:21:40 +08:00
parent 779a7fa57b
commit fad0d070b6
7 changed files with 198 additions and 49 deletions

View File

@@ -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}`;