huangjiajun 3 місяці тому
джерело
коміт
aeded5a4b4
1 змінених файлів з 8 додано та 4 видалено
  1. +8
    -4
      app/svc/platform/svc_withdrawal.go

+ 8
- 4
app/svc/platform/svc_withdrawal.go Переглянути файл

@@ -453,19 +453,23 @@ func masterMonthAmount(mid string) map[string]string {

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
lifeSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and create_time>=? and create_time<?", mid, lastMonthTimeRange["start"], lastMonthTimeRange["end"]).Sum(&model.LifeOrder{}, "commission")
lastMonthSum += hwSum + guideSum + lifeSum

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
lifeMonthSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.LifeOrder{}, "commission")
monthSum += hwMonthSum + guideMonthSum + lifeMonthSum

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
lifeMonthSettleSum, _ := db.ZhimengDb.In("status", []string{"订单结算"}).Where("uid=? and create_time>=? and create_time<?", mid, currentMonthTimeRange["start"], currentMonthTimeRange["end"]).Sum(&model.LifeOrder{}, "real_commission")
monthSettleSum += hwMonthSettleSum + guideMonthSettleSum + lifeMonthSettleSum

waithwSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and settle_time=0", mid).Sum(&model.HwOrder{}, "commission")
waitguideSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and settle_time=0", mid).Sum(&model.GuideOrder{}, "commission")
waitSum := waithwSum + waitguideSum
waitlifeSum, _ := db.ZhimengDb.NotIn("status", []string{"违规订单", "创建订单", "订单退款", "订单失效"}).Where("uid=? and settle_time=0", mid).Sum(&model.LifeOrder{}, "commission")
waitSum := waithwSum + waitguideSum + waitlifeSum
res := map[string]string{
"waitSum": utils.Float64ToStr(waitSum),
"last_month_amount": utils.Float64ToStr(lastMonthSum),


Завантаження…
Відмінити
Зберегти