|
@@ -38,16 +38,16 @@ func ProductPlan(r *GinRouter) {
|
|
|
}
|
|
|
|
|
|
func DownLoadPlan(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
- _packId := c.Query("id")
|
|
|
+ _planId := c.Query("id")
|
|
|
compId := c.Query("compId")
|
|
|
- packId, err := primitive.ObjectIDFromHex(_packId)
|
|
|
+ planId, err := primitive.ObjectIDFromHex(_planId)
|
|
|
if err != nil {
|
|
|
return nil, errors.New("packId错误")
|
|
|
}
|
|
|
plan := model.ProductPlan{}
|
|
|
found, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
|
|
|
CollectName: repo.CollectionProductPlan,
|
|
|
- Query: repo.Map{"pack._id": packId},
|
|
|
+ Query: repo.Map{"_id": planId},
|
|
|
}, &plan)
|
|
|
if !found || err != nil {
|
|
|
return nil, errors.New("数据未找到")
|