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

+ 3 - 3
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(?) and pass_time<FROM_UNIXTIME(?) and  status=? and wx_user_id=?;", tbn)
-	err := o.Raw(sql, beginTime, endTime, 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=? and wx_user_id=?;", tbn, beginTime, endTime)
+	err := o.Raw(sql, state, wxUserId).QueryRow(ret)
 	if err != nil {
 		beego.BeeLogger.Error("GetSumShopPerfomance err=[%s]", err)
 		return 0
@@ -110,7 +110,7 @@ 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)
+	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)
 	if err != nil {
 		beego.BeeLogger.Error("GetSumBalancePerfomance err=[%s]", err)