提交
This commit is contained in:
@@ -1046,9 +1046,9 @@ class MatchingService {
|
||||
}
|
||||
|
||||
// 确保至少有最小笔数
|
||||
if (allocations.length < minTransfers) {
|
||||
throw new Error(`无法生成足够的分配:需要至少${minTransfers}笔,但只能生成${allocations.length}笔`);
|
||||
}
|
||||
// if (allocations.length < minTransfers) {
|
||||
// throw new Error(`无法生成足够的分配:需要至少${minTransfers}笔,但只能生成${allocations.length}笔`);
|
||||
// }
|
||||
|
||||
// 精确控制总金额,避免超出预期
|
||||
const currentTotal = allocations.reduce((sum, a) => sum + a.amount, 0);
|
||||
|
||||
@@ -363,7 +363,7 @@ class TransferService {
|
||||
}
|
||||
}
|
||||
|
||||
async getTransfersHistory(filters = {}, pagination = {}, user_type = 'user_to_user') {
|
||||
async getTransfersHistory(filters = {}, pagination = {}, user_type = 'manual') {
|
||||
const db = getDB();
|
||||
const {page = 1, limit = 10, sort = 'created_at', order = 'desc'} = pagination;
|
||||
const pageNum = parseInt(page, 10) || 1;
|
||||
@@ -372,7 +372,7 @@ class TransferService {
|
||||
|
||||
let whereClause = 'WHERE 1=1 ';
|
||||
const params = [];
|
||||
whereClause += `AND transfer_type != '${user_type}'`;
|
||||
whereClause += `AND source_type != '${user_type}'`;
|
||||
// 构建查询条件
|
||||
if (filters.user_id) {
|
||||
whereClause += ' AND (from_user_id = ? OR to_user_id = ?)';
|
||||
|
||||
Reference in New Issue
Block a user