|
|
@@ -55,13 +55,13 @@ public interface SecondTradeRecordMapper extends BaseMapper<SecondTradeRecord> {
|
|
|
SecondTradeRecordVo getTradeRecordById(@Param("id") Integer id);
|
|
|
|
|
|
@Select("with record as ( " +
|
|
|
- " select buyer_id userId, count(1) num, 'buyer' flag " +
|
|
|
+ " select buyer_id userId, count(1) num, 'buyer' flag, max(transaction_time) time " +
|
|
|
" from second_trade_record " +
|
|
|
" where delete_flag = 0 and trade_status = 4 and failure_flag = 0 " +
|
|
|
" and transaction_time >= #{beginTime} and transaction_time <= #{endTime} " +
|
|
|
" group by buyer_id " +
|
|
|
" union all " +
|
|
|
- " select seller_id userId, count(1) num, 'seller' flag " +
|
|
|
+ " select seller_id userId, count(1) num, 'seller' flag, max(transaction_time) time " +
|
|
|
" from second_trade_record " +
|
|
|
" where delete_flag = 0 and trade_status = 4 and failure_flag = 0 " +
|
|
|
" and transaction_time >= #{beginTime} and transaction_time <= #{endTime} " +
|
|
|
@@ -69,14 +69,14 @@ public interface SecondTradeRecordMapper extends BaseMapper<SecondTradeRecord> {
|
|
|
") " +
|
|
|
"select a.*, ifnull(b.num, 0) buyer, ifnull(c.num, 0) seller, user.user_name userName, concat('user_', user.user_phone) phoneId, user.user_phone userPhone " +
|
|
|
"from ( " +
|
|
|
- " select userId, sum(num) num " +
|
|
|
+ " select userId, sum(num) num, max(time) time " +
|
|
|
" from record " +
|
|
|
" group by userId " +
|
|
|
") a " +
|
|
|
"left join record b on a.userId = b.userId and b.flag = 'buyer' " +
|
|
|
"left join record c on a.userId = c.userId and c.flag = 'seller' " +
|
|
|
"join life_user user on user.id = a.userId and user.delete_flag = 0 " +
|
|
|
- "order by a.num desc " +
|
|
|
+ "order by a.num desc, a.time " +
|
|
|
"limit 20 ")
|
|
|
List<JSONObject> getRankingList(@Param("beginTime") String beginTime, @Param("endTime") String endTime);
|
|
|
}
|