|
|
@@ -42,6 +42,7 @@ func WithdrawalIncome(c *gin.Context) { |
|
|
|
var tmpAgent = map[string]string{"name": "账户二余额", "value": amountMap["agent_amount"], "type": "agent_amount", "tip": "", "alipay": amountMap["alipay"], "alipay_name": amountMap["alipay_name"], "is_need_bing_alipay": isNeedBingAlipay, "is_show_withdrawal": "1"} |
|
|
|
res = append(res, tmpAgent) |
|
|
|
} |
|
|
|
res = append(res, map[string]string{"name": "未结算收益", "value": monthAmountMap["waitSum"], "type": "waitSum", "tip": "", "is_need_bing_alipay": "0", "is_show_withdrawal": "0"}) |
|
|
|
res = append(res, map[string]string{"name": "上月预估收益", "value": monthAmountMap["last_month_amount"], "type": "last_month_amount", "tip": "", "is_need_bing_alipay": "0", "is_show_withdrawal": "0"}) |
|
|
|
res = append(res, map[string]string{"name": "上月预估结算收益", "value": amountMap["last_month_settle_amount"], "type": "last_month_settle_amount", "tip": "", "is_need_bing_alipay": "0", "is_show_withdrawal": "0"}) |
|
|
|
res = append(res, map[string]string{"name": "本月预估收益", "value": monthAmountMap["month_amount"], "type": "month_amount", "tip": "", "is_need_bing_alipay": "0", "is_show_withdrawal": "0"}) |
|
|
@@ -421,19 +422,23 @@ func masterMonthAmount(mid string) map[string]string { |
|
|
|
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") |
|
|
|
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") |
|
|
|
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.In("status", []string{"订单结算"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.HwOrder{}, "commission") |
|
|
|
guideMonthSettleSum, _ := db.ZhimengDb.In("status", []string{"订单结算"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.GuideOrder{}, "real_commission") |
|
|
|
monthSettleSum += hwMonthSettleSum + guideMonthSettleSum |
|
|
|
|
|
|
|
waithwSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and settle_at=0", mid).Sum(&model.HwOrder{}, "commission") |
|
|
|
waitguideSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and settle_at=0", mid).Sum(&model.GuideOrder{}, "commission") |
|
|
|
waitSum := waithwSum + waitguideSum |
|
|
|
res := map[string]string{ |
|
|
|
"waitSum": utils.Float64ToStr(waitSum), |
|
|
|
"last_month_amount": utils.Float64ToStr(lastMonthSum), |
|
|
|
"month_amount": utils.Float64ToStr(monthSum), |
|
|
|
"month_settle_amount": utils.Float64ToStr(monthSettleSum), |
|
|
|