|
@@ -19,8 +19,9 @@ func Order(r *GinRouter) {
|
|
|
// 订单列表
|
|
|
func OrderList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
page, size, query := UtilQueryPageSize(c)
|
|
|
- _userId := apictx.User.ID
|
|
|
- userId, _ := primitive.ObjectIDFromHex(_userId)
|
|
|
+ // _userId := apictx.User.ID
|
|
|
+ // userId, _ := primitive.ObjectIDFromHex(_userId)
|
|
|
+ userId, _ := primitive.ObjectIDFromHex("636c66874fa01c203c478ba9")
|
|
|
// 供应商的订单列表
|
|
|
query["supplyId"] = userId
|
|
|
result, err := repo.RepoPageSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
@@ -28,7 +29,7 @@ func OrderList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
Page: page,
|
|
|
Size: size,
|
|
|
Query: query,
|
|
|
- Project: []string{"createTime", "userId", "supplyId", "products"},
|
|
|
+ Project: []string{"createTime", "userId", "supplyId", "products", "status"},
|
|
|
Sort: repo.Map{"createTime": -1},
|
|
|
})
|
|
|
|
|
@@ -51,7 +52,7 @@ func OrderList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
orderCount = len(v["products"].(primitive.A))
|
|
|
if orderCount > 0 {
|
|
|
for _, p := range v["products"].(primitive.A) {
|
|
|
- if p.(map[string]interface{})["status"] == -1 {
|
|
|
+ if p.(map[string]interface{})["status"].(int32) == -1 {
|
|
|
notShipCount++
|
|
|
}
|
|
|
}
|