abiao пре 3 година
родитељ
комит
91090c143b
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      go/gopath/src/fohow.com/apps/models/product_model/product.go

+ 3 - 3
go/gopath/src/fohow.com/apps/models/product_model/product.go

@@ -136,7 +136,7 @@ func GetLatest(page, perPage, recommend, priceSort, saleSort, saleZone int64, pt
 	}
 	var saleZoneSql, priceSql, saleSql, orderSql string
 	if saleZone > int64(0) {
-		saleZoneSql = fmt.Sprintf("and sale_zone=%d", saleZone)
+		saleZoneSql = fmt.Sprintf(" and sale_zone=%d", saleZone)
 	}
 	if priceSort == int64(1) {
 		//降序
@@ -302,10 +302,10 @@ func GetProductsByCatId(cId, saleZone, page, perPage, priceSort, saleSort int64,
 
 	var cidSql string
 	if cId != 0 {
-		cidSql = fmt.Sprintf("and category_id=%d", cId)
+		cidSql = fmt.Sprintf(" and category_id=%d", cId)
 	}
 	if saleZone != 0 {
-		cidSql = cidSql + fmt.Sprintf("and sale_zone=%d", saleZone)
+		cidSql = cidSql + fmt.Sprintf(" and sale_zone=%d", saleZone)
 	}
 
 	if len(words) > 0 {