微信支付回调 回扫去掉退款和退款中状态的修改,报表统计修改
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.peanut.modules.common.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.common.entity.BuyOrderBatchDeliveryItem;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface BuyOrderBatchDeliveryItemDao extends BaseMapper<BuyOrderBatchDeliveryItem> {
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.peanut.modules.common.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.peanut.modules.common.entity.BuyOrderBatchDeliveryTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BuyOrderBatchDeliveryTaskDao extends BaseMapper<BuyOrderBatchDeliveryTask> {
|
||||
|
||||
@Select("<script>" +
|
||||
"SELECT i.order_id FROM buy_order_batch_delivery_item i " +
|
||||
"INNER JOIN buy_order_batch_delivery_task t ON t.id = i.task_id " +
|
||||
"WHERE t.status IN (0, 1) AND i.status IN (0, 1) AND i.order_id IN " +
|
||||
"<foreach collection='orderIds' item='id' open='(' separator=',' close=')'>" +
|
||||
"#{id}" +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
List<Integer> findBusyOrderIds(@Param("orderIds") List<Integer> orderIds);
|
||||
}
|
||||
@@ -116,7 +116,9 @@ public class UserVipLogServiceImpl extends ServiceImpl<UserVipLogDao, UserVipLog
|
||||
}
|
||||
@Override
|
||||
public List<Map<String, Object>> getUserVipLogInfo(String date) {
|
||||
// date:报表截止日期,如 2026-06-30;从 DAO 查出未删除 + 已退款(del_flag=-1)的 VIP 明细及摊销
|
||||
List<Map<String, Object>> list = this.baseMapper.getUserVipLogInfo(date);
|
||||
// 以 uvlId 为 key,缓存「本月发生退款」的订单,供后续匹配主列表并生成退款行
|
||||
Map<String, Map<String, Object>> refundMap = new HashMap<>();
|
||||
for (Map<String, Object> refund : this.baseMapper.getMonthRefund(date)) {
|
||||
Object uvlId = refund.get("uvlId");
|
||||
@@ -124,37 +126,47 @@ public class UserVipLogServiceImpl extends ServiceImpl<UserVipLogDao, UserVipLog
|
||||
refundMap.put(uvlId.toString(), refund);
|
||||
}
|
||||
}
|
||||
// 最终返回给导出的明细列表(可能比 SQL 原始行数多,因退款会拆成「已付款行 + 已退款行」)
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
// 记录已在主列表中处理过的退款 uvlId,避免第二步重复追加
|
||||
Set<String> matchedUvlIds = new HashSet<>();
|
||||
for (Map<String, Object> row : list) {
|
||||
// 主列表默认标记为已付款
|
||||
row.put("orderStatus", "已付款");
|
||||
|
||||
Object uvlId = row.get("uvlId");
|
||||
// 若该 VIP 记录在本月有退款,则 refund 非空
|
||||
Map<String, Object> refund = uvlId == null ? null : refundMap.get(uvlId.toString());
|
||||
if (refund != null) {
|
||||
// 本月退款的订单:原「已付款」行当月/剩余摊销清零(退款单独成行体现)
|
||||
row.put("currentTanxiao",BigDecimal.ZERO);
|
||||
row.put("notyetTanxiao",BigDecimal.ZERO);
|
||||
String exportMonth = date.length() >= 7 ? date.substring(0, 7) : date;
|
||||
String payMonth = getPayMonth(row);
|
||||
// 本月付本月退:保留原已付款行(金额为正),再追加一条负金额退款行
|
||||
if (exportMonth.equals(payMonth)){
|
||||
result.add(row);
|
||||
}
|
||||
matchedUvlIds.add(uvlId.toString());
|
||||
// 追加「已退款」行,金额/摊销按 buildRefundRow 规则处理
|
||||
result.add(buildRefundRow(row, refund, date));
|
||||
|
||||
}else{
|
||||
// 无本月退款:原样加入结果
|
||||
result.add(row);
|
||||
}
|
||||
|
||||
}
|
||||
//其他月份下单、指定月份退款:主列表里没有对应行(user_vip_log已删除),单独追加到列表最下面
|
||||
// 其他月份下单、指定月份退款:主列表里没有对应行(user_vip_log已删除),单独追加到列表最下面
|
||||
String exportMonth = date.length() >= 7 ? date.substring(0, 7) : date;
|
||||
for (Map<String, Object> refund : refundMap.values()) {
|
||||
Object uvlId = refund.get("uvlId");
|
||||
// 已在主列表匹配过的跳过
|
||||
if (uvlId != null && matchedUvlIds.contains(uvlId.toString())) {
|
||||
continue;
|
||||
}
|
||||
String payMonth = getPayMonth(refund);
|
||||
// 早月付款、本月退款且主列表无行:仅用 refund 数据构造一条退款行
|
||||
if (!payMonth.isEmpty() && !exportMonth.equals(payMonth)) {
|
||||
result.add(buildRefundRow(refund, refund, date));
|
||||
}
|
||||
@@ -162,18 +174,18 @@ public class UserVipLogServiceImpl extends ServiceImpl<UserVipLogDao, UserVipLog
|
||||
return result;
|
||||
}
|
||||
public Map<String, Object> buildRefundRow(Map<String, Object> row, Map<String, Object> refund, String date) {
|
||||
// 复制原订单行作为退款行模板
|
||||
Map<String, Object> refundRow = new HashMap<>(row);
|
||||
log.info("n======o"+(refund.get("refund_no")==null?"":refund.get("refund_no").toString()));
|
||||
refundRow.put("orderStatus", "已退款");
|
||||
// 支付时间改为退款时间,便于导出展示
|
||||
refundRow.put("payTime", refund.get("refundTime"));
|
||||
refundRow.put("refund_no", refund.get("refund_no"));
|
||||
String exportMonth = date.length() >= 7 ? date.substring(0, 7) : date;
|
||||
String payMonth = getPayMonth(row);
|
||||
BigDecimal dayAmount = toBigDecimal(row.get("dayAmount"));
|
||||
log.info(date+":=====p:"+payMonth+",e:"+exportMonth+","+refund.get("orderSn").toString());
|
||||
if (exportMonth.equals(payMonth)) {
|
||||
|
||||
//当月订单当月退款:金额为负,当月/剩余摊销为0
|
||||
// 当月订单当月退款:金额为负,当月/剩余摊销为0
|
||||
refundRow.put("price", toBigDecimal(row.get("price")).negate());
|
||||
refundRow.put("fee", toBigDecimal(row.get("fee")).negate());
|
||||
refundRow.put("alreadyDays", 0);
|
||||
@@ -183,7 +195,7 @@ public class UserVipLogServiceImpl extends ServiceImpl<UserVipLogDao, UserVipLog
|
||||
refundRow.put("currentTanxiao", BigDecimal.ZERO);
|
||||
refundRow.put("notyetTanxiao", BigDecimal.ZERO);
|
||||
} else if (!payMonth.isEmpty() && !exportMonth.equals(payMonth)) {
|
||||
//其他月份下单、指定月份退款:订单金额为0,冲回已摊销部分
|
||||
// 其他月份下单、指定月份退款:冲回截至上月末的已摊销,当月摊销为负的已摊销额
|
||||
int alreadyDays = calcAlreadyDaysToPrevMonthEnd(row, date);
|
||||
BigDecimal alreadyTanxiao = dayAmount.multiply(new BigDecimal(alreadyDays)).setScale(2, RoundingMode.HALF_UP);
|
||||
refundRow.put("price", toBigDecimal(row.get("price")).negate());
|
||||
@@ -192,10 +204,12 @@ public class UserVipLogServiceImpl extends ServiceImpl<UserVipLogDao, UserVipLog
|
||||
refundRow.put("currentDays", 0);
|
||||
refundRow.put("notyetDays", 0);
|
||||
refundRow.put("alreadyTanxiao", 0);
|
||||
// 当月摊销 = 负的「付款月至上月末」累计摊销
|
||||
refundRow.put("currentTanxiao", alreadyTanxiao.negate());
|
||||
refundRow.put("notyetTanxiao", 0);
|
||||
refundRow.put("startTime", refund.get("refundTime"));
|
||||
} else {
|
||||
// 兜底:按原行已摊销冲回
|
||||
refundRow.put("price", toBigDecimal(row.get("price")).negate());
|
||||
refundRow.put("fee", toBigDecimal(row.get("fee")).negate());
|
||||
refundRow.put("alreadyDays", row.get("alreadyDays"));
|
||||
|
||||
@@ -616,7 +616,6 @@ public class StatisticsController {
|
||||
BigDecimal refundFeeToSR = BigDecimal.ZERO;
|
||||
BigDecimal refundMonthTX = BigDecimal.ZERO;
|
||||
BigDecimal refundYetTX = BigDecimal.ZERO;
|
||||
if(date.equals("2026-04-30"))log.info("currentTanxiao======="+map.get("currentTanxiao").toString());
|
||||
for (Map<String,Object> one : monthRefundMap) {
|
||||
String payMonth = userVipLogService.getPayMonth(one);
|
||||
if (exportMonth.equals(payMonth)) {
|
||||
|
||||
@@ -185,7 +185,7 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
|
||||
payWechatOrderService.updateById(payWechatOrderEntity);
|
||||
// 根据订单号,做幂等处理,并且在对业务数据进行状态检查和处理之前,要采用数据锁进行并发控制,以避免函数重入造成的数据混乱
|
||||
BuyOrder order = this.buyOrderService.getOne(new QueryWrapper<BuyOrder>().eq("order_sn", orderNo));
|
||||
if ("3".equals(order.getOrderStatus())){
|
||||
if ("3".equals(order.getOrderStatus())||"6".equals(order.getOrderStatus())||"7".equals(order.getOrderStatus())){
|
||||
return;
|
||||
}
|
||||
//使用优惠券
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
select r.*
|
||||
,ROUND(fee-alreadyTanxiao-currentTanxiao,2) surplusTanxiao
|
||||
from (select e.*
|
||||
,ROUND(if(alreadyDay+currentDay>=days,fee-alreadyTanxiao,if(alreadyTanxiao+currentDay*dayAmount>fee,fee-alreadyTanxiao,currentDay*dayAmount)),2) currentTanxiao
|
||||
,ROUND(if(CHAR_LENGTH(IFNULL(endTime,'')) < 10, if(alreadyDay+currentDay>=days,fee-alreadyTanxiao,if(alreadyTanxiao+currentDay*dayAmount>fee,fee-alreadyTanxiao,currentDay*dayAmount)), if(DATEDIFF(#{date}, LEFT(endTime,10)) >= 0, 0, if(alreadyDay+currentDay>=days,fee-alreadyTanxiao,if(alreadyTanxiao+currentDay*dayAmount>fee,fee-alreadyTanxiao,currentDay*dayAmount)))),2) currentTanxiao
|
||||
from (select w.name,w.tel,w.ctitle,w.cctitle,if(w.startTime is null,'',w.startTime) startTime,if(w.endTime is null,'',w.endTime) endTime,w.totalDays
|
||||
,w.type,w.payType,w.payTime,w.orderSn,w.zfbOrder,w.days,w.fee,w.remark,w.dayAmount,w.alreadyDay,w.currentDay
|
||||
,IF(beginDay=0,startTime,IF(startTime is NULL,startTime,DATE_ADD(startTime,INTERVAL beginDay-1 day))) startTanxiaoTime
|
||||
,ROUND(if(alreadyDay=days,fee,if(alreadyDayAmount>fee,fee,alreadyDayAmount)),2) alreadyTanxiao
|
||||
,ROUND(if(CHAR_LENGTH(IFNULL(endTime,'')) < 10, if(alreadyDay=days,fee,if(alreadyDayAmount>fee,fee,alreadyDayAmount)), if(DATEDIFF(#{date}, LEFT(endTime,10)) >= 0, fee, if(alreadyDay=days,fee,if(alreadyDayAmount>fee,fee,alreadyDayAmount)))),2) alreadyTanxiao
|
||||
from (
|
||||
select q.*,alreadyDay*dayAmount alreadyDayAmount
|
||||
,IF(days-alreadyDay=0,0,IF(beginDay=0,IF(startTime is NULL,0,IF(days-alreadyDay>=monthDays,if(DATE_FORMAT(startTime,'%Y-%m')=SUBSTR(#{date},1,7),DATEDIFF(#{date},startTime)+1,if(DATE_FORMAT(startTime,'%Y-%m')>SUBSTR(#{date},1,7),0,monthDays)),if(DATE_FORMAT(startTime, '%Y-%m')=SUBSTR(#{date},1,7),if(DATEDIFF(#{date},startTime)+1>days,days,DATEDIFF(#{date},startTime)+1),if(DATE_FORMAT(startTime, '%Y-%m') < SUBSTR(#{date},1,7),days-alreadyDay,0)))), if(alreadyTotalDay+monthDays>beginDay,if(alreadyDay>0,if(days-alreadyDay>monthDays,monthDays,monthDays-(days-alreadyDay)),monthDays-(totalDays-days-alreadyTotalDay)),0) )) currentDay
|
||||
@@ -41,12 +41,28 @@
|
||||
</select>
|
||||
|
||||
<select id="getIncome" resultType="map">
|
||||
select ucbl.pay_type,SUM(ucbl.fee) fee
|
||||
from user_course_buy_log ucbl
|
||||
left join buy_order bo on bo.order_sn = ucbl.order_sn
|
||||
where DATE_FORMAT(ucbl.pay_time,'%Y-%m') = SUBSTR(#{date},1,7) and ucbl.del_flag = 0
|
||||
and (ucbl.user_id not in (select id from user where tester_flag = 1) or ( ucbl.user_id in (select id from user where tester_flag = 1) and ucbl.pay_type in ('微信','支付宝') and ucbl.create_time>='2026-05-06 00:00:00'))
|
||||
GROUP BY ucbl.pay_type
|
||||
select pay_type, SUM(fee) fee
|
||||
from (
|
||||
select ucbl.pay_type, ucbl.fee
|
||||
from user_course_buy_log ucbl
|
||||
left join buy_order bo on bo.order_sn = ucbl.order_sn
|
||||
where DATE_FORMAT(ucbl.pay_time,'%Y-%m') = SUBSTR(#{date},1,7) and ucbl.del_flag = 0
|
||||
and (ucbl.user_id not in (select id from user where tester_flag = 1) or ( ucbl.user_id in (select id from user where tester_flag = 1) and ucbl.pay_type in ('微信','支付宝') and ucbl.create_time>='2026-05-06 00:00:00'))
|
||||
union all
|
||||
select IF(bo.payment_method='1','微信',IF(bo.payment_method='2','支付宝',IF(bo.payment_method='4','天医币','其他'))) pay_type,
|
||||
bo.real_money fee
|
||||
from buy_order bo
|
||||
where bo.order_type = 'relearn' and bo.del_flag = 0
|
||||
and bo.order_status not in ('5','6')
|
||||
and DATE_FORMAT(IF(bo.success_time is null,bo.create_time,bo.success_time),'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
and not exists (
|
||||
select 1 from user_course_buy_log ucbl
|
||||
where ucbl.order_sn = bo.order_sn and ucbl.del_flag = 0
|
||||
)
|
||||
and (bo.user_id not in (select id from user where tester_flag = 1)
|
||||
or (bo.user_id in (select id from user where tester_flag = 1) and bo.payment_method in ('1','2') and bo.create_time>='2026-05-06 00:00:00'))
|
||||
) t
|
||||
GROUP BY pay_type
|
||||
</select>
|
||||
<select id="getRefund" resultType="map">
|
||||
select pay_type,SUM(fee) fee
|
||||
@@ -59,11 +75,11 @@
|
||||
and DATE_FORMAT(bor.create_time,'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
and (bo.user_id not in (select id from user where tester_flag = 1)
|
||||
or (bo.user_id in (select id from user where tester_flag = 1) and bo.payment_method in ('1','2') and bo.create_time>='2026-05-06 00:00:00'))
|
||||
and exists (
|
||||
and (bo.order_type = 'relearn' or exists (
|
||||
select 1 from buy_order_product bop
|
||||
inner join shop_product sp on sp.product_id = bop.product_id
|
||||
where bop.order_id = bo.order_id and sp.goods_type = '05'
|
||||
)
|
||||
))
|
||||
) t
|
||||
GROUP BY pay_type
|
||||
</select>
|
||||
@@ -79,11 +95,11 @@
|
||||
and DATE_FORMAT(IF(bo.success_time is null,bo.create_time,bo.success_time),'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
and (bo.user_id not in (select id from user where tester_flag = 1)
|
||||
or (bo.user_id in (select id from user where tester_flag = 1) and bo.payment_method in ('1','2') and bo.create_time>='2026-05-06 00:00:00'))
|
||||
and exists (
|
||||
and (bo.order_type = 'relearn' or exists (
|
||||
select 1 from buy_order_product bop
|
||||
inner join shop_product sp on sp.product_id = bop.product_id
|
||||
where bop.order_id = bo.order_id and sp.goods_type = '05'
|
||||
)
|
||||
))
|
||||
) t
|
||||
GROUP BY pay_type
|
||||
</select>
|
||||
@@ -159,11 +175,11 @@
|
||||
select r.*
|
||||
,ROUND(fee-alreadyTanxiao-currentTanxiao,2) surplusTanxiao
|
||||
from (select e.*
|
||||
,ROUND(if(alreadyDay+currentDay>=days,fee-alreadyTanxiao,if(alreadyTanxiao+currentDay*dayAmount>fee,fee-alreadyTanxiao,currentDay*dayAmount)),2) currentTanxiao
|
||||
,ROUND(if(CHAR_LENGTH(IFNULL(endTime,'')) < 10, if(alreadyDay+currentDay>=days,fee-alreadyTanxiao,if(alreadyTanxiao+currentDay*dayAmount>fee,fee-alreadyTanxiao,currentDay*dayAmount)), if(DATEDIFF(#{date}, LEFT(endTime,10)) >= 0, 0, if(alreadyDay+currentDay>=days,fee-alreadyTanxiao,if(alreadyTanxiao+currentDay*dayAmount>fee,fee-alreadyTanxiao,currentDay*dayAmount)))),2) currentTanxiao
|
||||
from (select w.name,w.tel,w.ctitle,w.cctitle,if(w.startTime is null,'',w.startTime) startTime,if(w.endTime is null,'',w.endTime) endTime,w.totalDays
|
||||
,w.type,w.payType,w.payTime,w.orderSn,w.zfbOrder,w.days,w.fee,w.remark,w.dayAmount,w.alreadyDay,w.currentDay
|
||||
,IF(beginDay=0,startTime,IF(startTime is NULL,startTime,DATE_ADD(startTime,INTERVAL beginDay-1 day))) startTanxiaoTime
|
||||
,ROUND(if(alreadyDay=days,fee,if(alreadyDayAmount>fee,fee,alreadyDayAmount)),2) alreadyTanxiao
|
||||
,ROUND(if(CHAR_LENGTH(IFNULL(endTime,'')) < 10, if(alreadyDay=days,fee,if(alreadyDayAmount>fee,fee,alreadyDayAmount)), if(DATEDIFF(#{date}, LEFT(endTime,10)) >= 0, fee, if(alreadyDay=days,fee,if(alreadyDayAmount>fee,fee,alreadyDayAmount)))),2) alreadyTanxiao
|
||||
from (
|
||||
select q.*,alreadyDay*dayAmount alreadyDayAmount
|
||||
,IF(days-alreadyDay=0,0,IF(beginDay=0,IF(startTime is NULL,0,IF(days-alreadyDay>=monthDays,if(DATE_FORMAT(startTime,'%Y-%m')=SUBSTR(#{date},1,7),DATEDIFF(#{date},startTime)+1,if(DATE_FORMAT(startTime,'%Y-%m')>SUBSTR(#{date},1,7),0,monthDays)),if(DATE_FORMAT(startTime, '%Y-%m')=SUBSTR(#{date},1,7),if(DATEDIFF(#{date},startTime)+1>days,days,DATEDIFF(#{date},startTime)+1),if(DATE_FORMAT(startTime, '%Y-%m') < SUBSTR(#{date},1,7),days-alreadyDay,0)))), if(alreadyTotalDay+monthDays>beginDay,if(alreadyDay>0,if(days-alreadyDay>monthDays,monthDays,monthDays-(days-alreadyDay)),monthDays-(totalDays-days-alreadyTotalDay)),0) )) currentDay
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
IF(DATE_FORMAT(uvl.start_time, '%Y-%m') > SUBSTR(#{date},1,7),0,IF(DATE_FORMAT(uvl.end_time, '%Y-%m') < SUBSTR(#{date},1,7),0,IF(DATE_FORMAT(uvl.end_time, '%Y-%m') > SUBSTR(#{date},1,7),if(DATE_FORMAT(uvl.start_time, '%Y-%m') = SUBSTR(#{date},1,7),DATEDIFF(#{date},uvl.start_time)+1,DAY(#{date})),DATEDIFF(uvl.end_time,concat(SUBSTR(#{date},1,7),'-01'))+1))) currentDays,
|
||||
IF(DATE_FORMAT(uvl.start_time, '%Y-%m') > SUBSTR(#{date},1,7),DATEDIFF(uvl.end_time,uvl.start_time)+1,(IF(DATE_FORMAT(uvl.end_time, '%Y-%m') <= SUBSTR(#{date},1,7),0,DATEDIFF(uvl.end_time,#{date})))) notyetDays
|
||||
from user_vip_log uvl LEFT JOIN buy_order a ON a.order_sn=uvl.order_sn
|
||||
LEFT JOIN buy_order_refund b ON a.order_id=b.order_id
|
||||
left join user_vip uv on uv.id = uvl.user_vip_id
|
||||
left join user u on u.id = uvl.user_id
|
||||
left join pay_zfb_order pzo on pzo.relevanceOid = uvl.order_sn and pzo.trade_no is not null
|
||||
where u.del_flag = 0 and (uvl.del_flag = 0 or (uvl.del_flag = -1 and a.order_status=6))
|
||||
and (DATE_FORMAT(b.create_time, '%Y-%m')>=SUBSTR(#{date},1,7) || ISNULL(b.create_time))
|
||||
AND (uv.del_flag = 0 OR (uv.del_flag = -1 AND a.order_status=6))
|
||||
and DATE_FORMAT(IF(uvl.pay_time is NULL,uvl.start_time,uvl.pay_time), '%Y-%m') <= SUBSTR(#{date},1,7)
|
||||
and
|
||||
@@ -264,7 +266,8 @@
|
||||
left join user_vip uv on uv.id = uvl.user_vip_id
|
||||
left join user u on u.id = uvl.user_id
|
||||
left join pay_zfb_order pzo on pzo.relevanceOid = uvl.order_sn and pzo.trade_no is not null
|
||||
where u.del_flag = 0 and uvl.del_flag = 0 and uv.del_flag = 0 and DATE_FORMAT(IF(uvl.pay_time is NULL,uvl.start_time,uvl.pay_time), '%Y-%m') <= SUBSTR(#{date},1,7) and u.id not in (select id from user where tester_flag = 1)
|
||||
where u.del_flag = 0 and uvl.del_flag = 0 and uv.del_flag = 0 and DATE_FORMAT(IF(uvl.pay_time is NULL,uvl.start_time,uvl.pay_time), '%Y-%m') <= SUBSTR(#{date},1,7)
|
||||
and (u.id not in (select id from user where tester_flag = 1) or (u.id in (select id from user where tester_flag = 1) and (uvl.pay_type in('微信','支付宝') and uvl.create_time>='2026-05-06 00:00:00')))
|
||||
order by uvl.end_time asc
|
||||
) t order by currentDays desc
|
||||
) s
|
||||
@@ -299,7 +302,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getUserVipRefundFeeTotal" resultType="java.math.BigDecimal">
|
||||
select IFNULL(SUM(c.fee),0)
|
||||
select IFNULL(SUM(uvl.price),0)
|
||||
from user_vip_log uvl
|
||||
left join user_vip uv on uv.id = uvl.user_vip_id
|
||||
left join user u on u.id = uvl.user_id
|
||||
|
||||
Reference in New Issue
Block a user