Преглед изворни кода

Merge branch 'cygx_9.8' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

xingzai пре 2 година
родитељ
комит
b6b467a986
2 измењених фајлова са 5 додато и 4 уклоњено
  1. 4 4
      services/activity_special_trip.go
  2. 1 0
      utils/constants.go

+ 4 - 4
services/activity_special_trip.go

@@ -84,8 +84,8 @@ func GetTripRemainingtimesBycompany(user *models.WxUserItem, activityInfo *model
 		}
 		//condition += ` AND is_valid = 1 `
 		//查询当年的数据
-		condition += ` AND create_time > ?  `
-		pars = append(pars, time.Now().Format(utils.FormatDate))
+		condition += ` AND create_time >= ?  `
+		pars = append(pars, time.Now().Format(utils.FormatYearDate)+"-01-01")
 		listTripBill, e := models.GetCygxActivitySpecialTripBill(condition, pars)
 		if e != nil {
 			err = errors.New("GetActivitySpecialTripCountByActivitySpecial, Err: " + e.Error())
@@ -117,8 +117,8 @@ func GetTripRemainingtimesBycompany(user *models.WxUserItem, activityInfo *model
 			return
 		}
 		//查询当年的数据
-		condition += ` AND create_time > ?  `
-		pars = append(pars, time.Now().Format(utils.FormatDate))
+		condition += ` AND create_time >= ?  `
+		pars = append(pars, time.Now().Format(utils.FormatYearDate)+"-01-01")
 		listTripBill, e := models.GetCygxActivitySpecialTripBill(condition, pars)
 		if e != nil {
 			err = errors.New("GetActivitySpecialTripCountByActivitySpecial, Err: " + e.Error())

+ 1 - 0
utils/constants.go

@@ -13,6 +13,7 @@ const (
 	FormatDateTimeNoSecond = "2006-01-02 15:04"        //完整时间格式
 	FormatDateTimeUnSpace  = "20060102150405"          //完整时间格式
 	PageSize15             = 15                        //列表页每页数据量
+	FormatYearDate         = "2006"                    //日期格式
 	PageSize5              = 5
 	PageSize10             = 10
 	PageSize20             = 20