diff --git a/routes/supplier.js b/routes/supplier.js index 16c345d..b56bfc8 100644 --- a/routes/supplier.js +++ b/routes/supplier.js @@ -224,7 +224,7 @@ router.get('/list', async (req, res) => { .where('user_type=?', 'supplier') .where('is_delete=?', false) if (name) { - userCountQuery.where('(username LIKE ? or phone LIKE ?)', name, name) + userCountQuery.where('(username LIKE ? or phone LIKE ?)', `%${name}%`, `%${name}%`) } const data = await userCountQuery.paginateWithCount(db, page, limit); return res.json(data)