Browse Source

no message

zhangchuanxing 2 weeks ago
parent
commit
05642dcf21
2 changed files with 12 additions and 2 deletions
  1. 11 0
      models/cygx/activity_special.go
  2. 1 2
      services/cygx/resource_data.go

+ 11 - 0
models/cygx/activity_special.go

@@ -499,3 +499,14 @@ func GetactivitySpecilIdsByLabel(name string) (activityIds string, err error) {
 	err = o.Raw(sql).QueryRow(&activityIds)
 	return
 }
+
+// 获取数量
+func GetActivitySpecilCount(condition string, pars []interface{}) (count int, err error) {
+	sqlCount := ` SELECT COUNT(1) AS count  FROM cygx_activity_special as art WHERE 1= 1  `
+	if condition != "" {
+		sqlCount += condition
+	}
+	o := orm.NewOrmUsingDB("hz_cygx")
+	err = o.Raw(sqlCount, pars).QueryRow(&count)
+	return
+}

+ 1 - 2
services/cygx/resource_data.go

@@ -181,7 +181,7 @@ func UpdateActivitySpecialResourceData(sourceId int) {
 	var pars []interface{}
 	condition = ` AND publish_status = 1  AND  activity_id = ?  `
 	pars = append(pars, sourceId)
-	total, e := cygx.GetActivityCount(condition, pars)
+	total, e := cygx.GetActivitySpecilCount(condition, pars)
 	if e != nil {
 		err = errors.New("GetCygxReportSelection, Err: " + e.Error())
 		return
@@ -229,7 +229,6 @@ func UpdateActivitySpecialResourceData(sourceId int) {
 		} else {
 			item.SearchOrderTime = activityInfo.PublishDate
 		}
-
 		if totalData == 0 {
 			newId, e := cygx.AddCygxResourceData(item)
 			if e != nil {