|
@@ -70,35 +70,36 @@ func CollListSql(c *CollList, isPay bool, userid string) string {
|
|
|
sql += `)`
|
|
|
}
|
|
|
}
|
|
|
- if isPay {
|
|
|
- now := time.Now()
|
|
|
- start, end := "", ""
|
|
|
- //收藏时间
|
|
|
- if c.SelectTime == "lately-7" { //最近7天
|
|
|
- start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
- } else if c.SelectTime == "lately-30" { //最近30天
|
|
|
- start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
- } else if c.SelectTime == "thisyear" { //去年
|
|
|
- start = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
- end = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
- } else if len(strings.Split(c.SelectTime, "_")) == 2 {
|
|
|
- if c.SelectTime != "0_0" {
|
|
|
- starttime := strings.Split(c.SelectTime, "_")[0]
|
|
|
- startstamp, _ := strconv.Atoi(starttime)
|
|
|
- start = time.Unix(int64(startstamp), 0).Format(qutil.Date_Full_Layout)
|
|
|
- endtime := strings.Split(c.SelectTime, "_")[1]
|
|
|
- et, _ := strconv.ParseInt(endtime, 0, 64)
|
|
|
- etTime := time.Unix(et, 0)
|
|
|
- end = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
- }
|
|
|
- }
|
|
|
- if start != "" && end != "" {
|
|
|
- sql += ` and createdate >= '` + start + `' and createdate < '` + end + `'`
|
|
|
- } else if start != "" && end == "" {
|
|
|
- sql += ` and createdate >= '` + start + `'`
|
|
|
- } else if start == "" && end != "" {
|
|
|
- sql += ` and createdate < '` + end + `'`
|
|
|
+ now := time.Now()
|
|
|
+ start, end := "", ""
|
|
|
+ //收藏时间
|
|
|
+ if c.SelectTime == "lately-7" { //最近7天
|
|
|
+ start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
+ } else if c.SelectTime == "lately-30" { //最近30天
|
|
|
+ start = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-30, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
+ } else if c.SelectTime == "thisyear" { //去年
|
|
|
+ start = fmt.Sprint(time.Date(now.Year()-1, 1, 1, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
+ end = fmt.Sprint(time.Date(now.Year()-1, 12, 31, 23, 59, 59, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
+ } else if len(strings.Split(c.SelectTime, "_")) == 2 {
|
|
|
+ if c.SelectTime != "0_0" {
|
|
|
+ starttime := strings.Split(c.SelectTime, "_")[0]
|
|
|
+ startstamp, _ := strconv.Atoi(starttime)
|
|
|
+ start = time.Unix(int64(startstamp), 0).Format(qutil.Date_Full_Layout)
|
|
|
+ endtime := strings.Split(c.SelectTime, "_")[1]
|
|
|
+ et, _ := strconv.ParseInt(endtime, 0, 64)
|
|
|
+ etTime := time.Unix(et, 0)
|
|
|
+ end = fmt.Sprint(time.Date(etTime.Year(), etTime.Month(), etTime.Day()+1, 0, 0, 0, 0, time.Local).Format(qutil.Date_Full_Layout))
|
|
|
}
|
|
|
+ }
|
|
|
+ if start != "" && end != "" {
|
|
|
+ sql += ` and createdate >= '` + start + `' and createdate < '` + end + `'`
|
|
|
+ } else if start != "" && end == "" {
|
|
|
+ sql += ` and createdate >= '` + start + `'`
|
|
|
+ } else if start == "" && end != "" {
|
|
|
+ sql += ` and createdate < '` + end + `'`
|
|
|
+ }
|
|
|
+ if isPay {
|
|
|
+
|
|
|
//采购单位 用,分隔开
|
|
|
if c.Buyerclass != "" {
|
|
|
i := 0
|