Browse Source

get user perfomance total

abiao 5 years ago
parent
commit
070cb2bd41

+ 4 - 2
go/gopath/src/fohow.com/apps/models/summary_model/user_perfomance.go

@@ -86,11 +86,12 @@ func GetSumShopPerfomance(wxUserId, beginTime, endTime int64) int64 {
 	type Ret struct {
 		Count int64
 	}
+	state := int64(1)
 	ret := &Ret{}
 	o := orm.NewOrm()
 	tbn := "shop_applications"
 	sql := fmt.Sprintf("SELECT sum(`total`) as count FROM `%s` WHERE  UNIX_TIMESTAMP(pass_time)>? and UNIX_TIMESTAMP(pass_time)<? and  status=? and wx_user_id=? ;", tbn)
-	err := o.Raw(sql, beginTime, endTime, 1, wxUserId).QueryRow(ret)
+	err := o.Raw(sql, beginTime, endTime, state, wxUserId).QueryRow(ret)
 	if err != nil {
 		beego.BeeLogger.Error("GetSumShopPerfomance err=[%s]", err)
 		return 0
@@ -105,11 +106,12 @@ func GetSumBalancePerfomance(wxUserId, beginTime, endTime int64) int64 {
 	type Ret struct {
 		Count int64
 	}
+	state := int64(1)
 	ret := &Ret{}
 	o := orm.NewOrm()
 	tbn := "balance_orders"
 	sql := fmt.Sprintf("SELECT sum(`paied_price`) as count FROM `%s` WHERE  paied_at>? and paied_at<? and  state=? and wx_user_id=? ;", tbn)
-	err := o.Raw(sql, beginTime, endTime, 1, wxUserId).QueryRow(ret)
+	err := o.Raw(sql, beginTime, endTime, state, wxUserId).QueryRow(ret)
 	if err != nil {
 		beego.BeeLogger.Error("GetSumBalancePerfomance err=[%s]", err)
 		return 0