|
|
@@ -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), |
|
|
|