|
@@ -5,8 +5,6 @@ import (
|
|
|
"3dshow-supplier/db/repo"
|
|
|
"3dshow-supplier/log"
|
|
|
"errors"
|
|
|
- "fmt"
|
|
|
- "strings"
|
|
|
"time"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
@@ -155,16 +153,16 @@ func ProductList(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
}
|
|
|
delete(query, "sort")
|
|
|
}
|
|
|
- // selectTime
|
|
|
- selectTime := time.Now().Format("2006-01")
|
|
|
- if _, ok := query["selectTime"]; ok {
|
|
|
- timeSlice := strings.Split(query["selectTime"].(string), ".")
|
|
|
- selectTime = strings.Join(timeSlice, "-")
|
|
|
- delete(query, "selectTime")
|
|
|
- }
|
|
|
- timeStr := fmt.Sprintf("%s%s", selectTime, "-01 00:00:00")
|
|
|
- formatTime, _ := time.ParseInLocation("2006-01-02 15:04:05", timeStr, time.Local)
|
|
|
- query["onsaleTime"] = bson.M{"$lte": formatTime}
|
|
|
+ // // selectTime
|
|
|
+ // selectTime := time.Now().Format("2006-01")
|
|
|
+ // if _, ok := query["selectTime"]; ok {
|
|
|
+ // timeSlice := strings.Split(query["selectTime"].(string), ".")
|
|
|
+ // selectTime = strings.Join(timeSlice, "-")
|
|
|
+ // delete(query, "selectTime")
|
|
|
+ // }
|
|
|
+ // timeStr := fmt.Sprintf("%s%s", selectTime, "-01 00:00:00")
|
|
|
+ // formatTime, _ := time.ParseInLocation("2006-01-02 15:04:05", timeStr, time.Local)
|
|
|
+ // query["onsaleTime"] = bson.M{"$lte": formatTime}
|
|
|
|
|
|
// 供应商 查询自己的商品
|
|
|
_userId := apictx.User.ID
|