wangshan 4 rokov pred
rodič
commit
766b755048

+ 1 - 1
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -140,7 +140,7 @@ func GetLabelByUser(userid string) (data []LabelByUser) {
 			labcount[strconv.FormatInt(v["id"].(int64), 10)] = qu.IntAll(v["count"])
 		}
 	}
-	if labArr := *db.Mysql.SelectBySql(fmt.Sprintf("select * from %s where  userid = ?", db.DbConf.Bdlabel), userid); len(labArr) > 0 {
+	if labArr := *db.Mysql.SelectBySql(fmt.Sprintf("select * from %s where  userid = ?  ORDER BY createdate DESC", db.DbConf.Bdlabel), userid); len(labArr) > 0 {
 		for _, v := range labArr {
 			l := new(LabelByUser)
 			lid := strconv.FormatInt(v["id"].(int64), 10)

+ 29 - 28
src/jfw/modules/publicapply/src/util/util.go

@@ -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