Browse Source

Merge branch 'master' of http://124.70.149.18:10880/sunsheng/3dshow-supplier

liwei 2 years ago
parent
commit
c748e95a66
2 changed files with 8 additions and 1 deletions
  1. BIN
      3dshow-supplier/__debug_bin
  2. 8 1
      3dshow-supplier/api/order.go

BIN
3dshow-supplier/__debug_bin


+ 8 - 1
3dshow-supplier/api/order.go

@@ -4,6 +4,7 @@ import (
 	"3dshow-supplier/db/model"
 	"3dshow-supplier/db/repo"
 	"errors"
+	"fmt"
 	"time"
 
 	"github.com/gin-gonic/gin"
@@ -113,6 +114,10 @@ func OrderDelivery(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	}
 	// 验证订单是不是自己的
 	_userId := apictx.User.ID
+	fmt.Println(_userId)
+	fmt.Println(form.Id.Hex())
+	fmt.Println(form.UniqueId.Hex())
+
 	userId, _ := primitive.ObjectIDFromHex(_userId)
 	order := model.Order{}
 	found, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
@@ -122,6 +127,7 @@ func OrderDelivery(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	if !found || err != nil {
 		return nil, errors.New("该订单未找到")
 	}
+	fmt.Println(order.SupplyId)
 	if userId != order.SupplyId {
 		return nil, errors.New("非法操作")
 	}
@@ -133,9 +139,10 @@ func OrderDelivery(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 		CollectName: repo.CollectionOrder,
 		Id:          form.Id.Hex(),
 		Query:       repo.Map{"products.id": form.UniqueId},
-		Set:         repo.Map{"status": 1, "expressNo": form.ExpressNo},
+		Set:         repo.Map{"products.$.status": 1, "products.$.expressNo": form.ExpressNo},
 	})
 	if err != nil {
+		fmt.Println(err)
 		return nil, errors.New("发货商品异常")
 	}