abiao лет назад: 5
Родитель
Сommit
6483d40bee

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

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