Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
8a087c51ca
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      app/svc/platform/svc_withdrawal.go

+ 15
- 0
app/svc/platform/svc_withdrawal.go View File

@@ -418,6 +418,21 @@ func masterMonthAmount(mid string) map[string]string {
lastMonthSum := playletSaleOrder.PlayletVideoOrderSum(mid, "", "last_month")
monthSum := playletSaleOrder.PlayletVideoOrderSum(mid, "", "current_month")
monthSettleSum := playletSaleOrder.PlayletVideoOrderSum(mid, "订单结算", "current_month")
lastMonthTimeRange := utils.GetTimeRange("last_month")
currentMonthTimeRange := utils.GetTimeRange("current_month")

hwSum, _ := db.ZhimengDb.NotIn("status", []string{"订单退款"}).Where("uid=? and create_time>=? and create_time<?", mid, lastMonthTimeRange["start"], lastMonthTimeRange["end"]).Sum(&model.HwOrder{}, "commission")
guideSum, _ := db.ZhimengDb.NotIn("status", []string{"订单退款"}).Where("uid=? and create_time>=? and create_time<?", mid, lastMonthTimeRange["start"], lastMonthTimeRange["end"]).Sum(&model.GuideOrder{}, "commission")
lastMonthSum += hwSum + guideSum

hwMonthSum, _ := db.ZhimengDb.NotIn("status", []string{"订单退款"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.HwOrder{}, "commission")
guideMonthSum, _ := db.ZhimengDb.NotIn("status", []string{"订单退款"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.GuideOrder{}, "commission")
monthSum += hwMonthSum + guideMonthSum

hwMonthSettleSum, _ := db.ZhimengDb.NotIn("status", []string{"订单退款"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.HwOrder{}, "commission")
guideMonthSettleSum, _ := db.ZhimengDb.NotIn("status", []string{"订单退款"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.GuideOrder{}, "real_commission")
monthSettleSum += hwMonthSettleSum + guideMonthSettleSum

res := map[string]string{
"last_month_amount": utils.Float64ToStr(lastMonthSum),
"month_amount": utils.Float64ToStr(monthSum),


Loading…
Cancel
Save