fix(admin): 用户360画像订单归属改用 expert_id IN (本人档案 id),与列表口径一致且避免 id 撞号

这个提交包含在:
xcbyy
2026-10-22 11:35:46 +08:00
父节点 32defce50c
当前提交 e595defaaf
共有 3 个文件被更改,包括 10 次插入 和 4 次删除

查看文件

@@ -4261,11 +4261,11 @@ export class MysqlRepository {
duration_hours as durationHours, amount, location, status, created_at as createdAt
FROM orders
WHERE buyer_id = ?
OR expert_id = ?
OR claimed_by = ?
OR companion_name IN (SELECT name FROM companions WHERE user_id = ? OR id = ?)
OR expert_id IN (SELECT id FROM companions WHERE user_id = ?)
OR companion_name IN (SELECT name FROM companions WHERE user_id = ?)
ORDER BY created_at DESC
`, [id, id, id, id, id]);
`, [id, id, id, id]);
// 资金流水(按 user_id 精确归属)
const [financeRecords]: any = await pool.query(`