abiao пре 2 година
родитељ
комит
a900f6d439
1 измењених фајлова са 5 додато и 8 уклоњено
  1. 5 8
      go/gopath/src/fohow.com/apps/models/order_model/order.go

+ 5 - 8
go/gopath/src/fohow.com/apps/models/order_model/order.go

@@ -915,8 +915,8 @@ func GenExpressPassword(expressNo string) string {
 func GetNotInvovedAmount(promotionId int64, orderId string) int64 {
 
 	type PromotionPds struct {
-		ProductId int64 `orm:"column(product_id)"                               json:"product_id"` // int(11)
-		Nums      int64 `orm:"column(nums)"                                     json:"nums"`       // int(11)
+		ProductId int64 `orm:"column(product_id)"`
+		Nums      int64 `orm:"column(nums)"`
 	}
 
 	sql := `
@@ -932,20 +932,17 @@ func GetNotInvovedAmount(promotionId int64, orderId string) int64 {
     	AND IF(od.nums IS NULL, 0, od.nums) > 0;
 		`
 
-	var results []*PromotionPds
+	var results []PromotionPds
 	db := orm.NewOrm()
-	_, err := db.Raw(sql, promotionId, orderId).QueryRows(&results)
+	_, err := db.Raw(sql, orderId, promotionId).QueryRows(&results)
 	if err != nil {
 		beego.BeeLogger.Debug("GetNotInvovedAmount err=%s", err)
 		return 0
 	}
+
 	total := int64(0)
 	for _, item := range results {
 		item_pd := product_model.GetProductById(item.ProductId, true)
-
-		beego.BeeLogger.Error("GetNotInvovedAmount-results.productId-%d", item.ProductId)
-		beego.BeeLogger.Error("GetNotInvovedAmount-results.price-%d", item_pd.Price)
-
 		total += item.Nums * item_pd.Price
 	}
 	beego.BeeLogger.Error("GetNotInvovedAmount-total-%d", total)