Преглед изворни кода

增加fohow 总提现金额

abiao пре 5 година
родитељ
комит
c69beeecc3

+ 10 - 6
go/gopath/src/fohow-statement-api/controllers/fohow_home_page_stat_controller/left_top_data_of_home_page.go

@@ -21,11 +21,13 @@ func (self *FohowLeftTopDataOfHomePageController) Get() {
 	//	platform_type = models.PLATFORM_TYPE_FANS_FOHOW
 	//}
 	type Ret struct {
-		TotalFans   int64 `json:"platform_total_fans"`
-		TotalRank1s int64 `json:"total_load1"`  //总店长
-		TotalRank2s int64 `json:"total_load2"`  //总群主
-		TotalInvest int64 `json:"total_invest"` //充值总额
-		TotalOrder  int64 `json:"total_order"`  //订单总额
+		TotalFans     int64 `json:"platform_total_fans"`
+		TotalRank1s   int64 `json:"total_load1"`  //总店长
+		TotalRank2s   int64 `json:"total_load2"`  //总群主
+		TotalInvest   int64 `json:"total_invest"` //充值总额
+		TotalOrder    int64 `json:"total_order"`  //订单总额
+		TotalTakeCash int64 `json:"total_order"`  //提现总额
+
 	}
 
 	//totalFans := models.GetFansTotalCountByType(platform_type)
@@ -34,7 +36,9 @@ func (self *FohowLeftTopDataOfHomePageController) Get() {
 	totalRank2 := models.GetRank2UsersTotalCount()
 	totalInvest := models.GetFohowAllRechargeTotal() / int64(100)
 	totalProject := models.GetFohowTotalOrderCount() / int64(100)
-	self.Data["json"] = &Ret{TotalFans: totalFans, TotalRank1s: total, TotalRank2s: totalRank2, TotalInvest: totalInvest, TotalOrder: totalProject}
+	totalTakeCash := models.GetFohowAllTakeCashTotal() / int64(100)
+
+	self.Data["json"] = &Ret{TotalTakeCash: totalTakeCash, TotalFans: totalFans, TotalRank1s: total, TotalRank2s: totalRank2, TotalInvest: totalInvest, TotalOrder: totalProject}
 
 	self.ServeJSON()
 }

+ 30 - 0
go/gopath/src/fohow-statement-api/models/d5c_bonus.go

@@ -91,6 +91,36 @@ func GetFohowAllRechargeTotal() int64 {
 	return ret.Total
 }
 
+//获取fohow提现总金额
+func GetFohowAllTakeCashTotal() int64 {
+	o := orm.NewOrm()
+	o.Using("fohow_data_source")
+
+	type Ret struct {
+		Total int64 `json:"total"`
+	}
+
+	var ret Ret
+
+	sql := `
+		SELECT
+			sum(count) AS total
+		FROM
+			take_cash_orders
+		Where
+			audit_state=1
+			;
+	`
+
+	err := o.Raw(sql).QueryRow(&ret)
+
+	if err != nil {
+		beego.BeeLogger.Warn("models.GetFohowAllTakeCashTotal err[%s]", err)
+		return 0
+	}
+	return ret.Total
+}
+
 //众筹总额:(类型:股权、收益权)(状态:除了审核中和准备中)项目,所有有效投资记录的总金额
 func GetD5cTotalProjectJoinInvestment() int64 {
 	o := orm.NewOrm()