From 131a28347f2c3ce272f61fce425a6eea4fa5e51c Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期五, 18 九月 2026 15:01:10 +0800
Subject: [PATCH] 更新....

---
 talent-card-server/src/main/java/com/talentcard/server/business/admin/AdminBusinessService.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/talent-card-server/src/main/java/com/talentcard/server/business/admin/AdminBusinessService.java b/talent-card-server/src/main/java/com/talentcard/server/business/admin/AdminBusinessService.java
index db80901..750c985 100644
--- a/talent-card-server/src/main/java/com/talentcard/server/business/admin/AdminBusinessService.java
+++ b/talent-card-server/src/main/java/com/talentcard/server/business/admin/AdminBusinessService.java
@@ -180,8 +180,8 @@
 		if (status != null) { sql.append(" and status = ?"); countSql.append(" and status = ?"); args.add(status); }
 		if (publishStart != null && !publishStart.isBlank()) { sql.append(" and date(publish_time) >= ?"); countSql.append(" and date(publish_time) >= ?"); args.add(publishStart); }
 		if (publishEnd != null && !publishEnd.isBlank()) { sql.append(" and date(publish_time) <= ?"); countSql.append(" and date(publish_time) <= ?"); args.add(publishEnd); }
-		// 置顶优先;置顶组内按“修改时间”倒序(最新修改的排前面,和人才端人才资讯一致),非置顶按排序值倒序。
-		sql.append(" order by is_top desc, case when is_top = 1 then updated_at end desc, sort_no desc, publish_time desc, id desc");
+		// 置顶优先;置顶组内按“置顶时间”倒序(越后置顶越靠前,和人才端政策列表一致),非置顶按排序值倒序。
+		sql.append(" order by is_top desc, case when is_top = 1 then top_time end desc, sort_no desc, publish_time desc, id desc");
 		return page(sql.toString(), countSql.toString(), page, size, args.toArray());
 	}
 
@@ -921,12 +921,18 @@
 				left join merchant_product p on p.id = r.product_id
 				left join merchant m on m.id = r.merchant_id
 				where r.deleted = 0
+				  and (r.product_id is null or r.id = (
+				         select max(newer.id) from merchant_product_audit_record newer
+				         where newer.deleted = 0 and newer.product_id = r.product_id))
 				""".formatted(salesCountSelect("r.product_id", "p")));
 		StringBuilder countSql = new StringBuilder("""
 				select count(*)
 				from merchant_product_audit_record r
 				left join merchant m on m.id = r.merchant_id
 				where r.deleted = 0
+				  and (r.product_id is null or r.id = (
+				         select max(newer.id) from merchant_product_audit_record newer
+				         where newer.deleted = 0 and newer.product_id = r.product_id))
 				""");
 		List<Object> args = new ArrayList<>();
 		if (merchantId != null) {

--
Gitblit v1.7.1