Browse Source

更新

master
huangjiajun 7 months ago
parent
commit
7c48fc55dc
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      app/svc/platform/svc_withdrawal.go

+ 9
- 4
app/svc/platform/svc_withdrawal.go View File

@@ -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"} 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, 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": 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": 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"}) 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") lastMonthTimeRange := utils.GetTimeRange("last_month")
currentMonthTimeRange := utils.GetTimeRange("current_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 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 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") 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") 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 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{ res := map[string]string{
"waitSum": utils.Float64ToStr(waitSum),
"last_month_amount": utils.Float64ToStr(lastMonthSum), "last_month_amount": utils.Float64ToStr(lastMonthSum),
"month_amount": utils.Float64ToStr(monthSum), "month_amount": utils.Float64ToStr(monthSum),
"month_settle_amount": utils.Float64ToStr(monthSettleSum), "month_settle_amount": utils.Float64ToStr(monthSettleSum),


Loading…
Cancel
Save