liwei 2 năm trước cách đây
mục cha
commit
4229fecb0e
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  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) {