liwei 2 jaren geleden
bovenliggende
commit
4229fecb0e
1 gewijzigde bestanden met toevoegingen van 9 en 0 verwijderingen
  1. 9 0
      boxcost/api/supplier-price.go

+ 9 - 0
boxcost/api/supplier-price.go

@@ -69,6 +69,9 @@ func SupplierPrice(r *GinRouter) {
 			if query["supplierId"] != nil {
 				query["supplierId"], _ = primitive.ObjectIDFromHex(query["supplierId"].(string))
 			}
+			if query["productId"] != nil {
+				query["productId"], _ = primitive.ObjectIDFromHex(query["productId"].(string))
+			}
 			return query
 		},
 
@@ -129,6 +132,9 @@ func SupplierPrice(r *GinRouter) {
 			if query["supplierId"] != nil {
 				query["supplierId"], _ = primitive.ObjectIDFromHex(query["supplierId"].(string))
 			}
+			if query["productId"] != nil {
+				query["productId"], _ = primitive.ObjectIDFromHex(query["productId"].(string))
+			}
 			return query
 		},
 		SearchPostProcess: func(page *repo.PageResult, c *gin.Context, apictx *ApiSession, query map[string]interface{}) (interface{}, error) {
@@ -187,6 +193,9 @@ func SupplierPrice(r *GinRouter) {
 			if query["supplierId"] != nil {
 				query["supplierId"], _ = primitive.ObjectIDFromHex(query["supplierId"].(string))
 			}
+			if query["productId"] != nil {
+				query["productId"], _ = primitive.ObjectIDFromHex(query["productId"].(string))
+			}
 			return query
 		},
 		SearchPostProcess: func(page *repo.PageResult, c *gin.Context, apictx *ApiSession, query map[string]interface{}) (interface{}, error) {