Эх сурвалжийг харах

Merge branch 'scheduleCount_fix' into debug

ziwen 2 жил өмнө
parent
commit
7c097141ca

+ 2 - 1
controllers/activity.go

@@ -445,7 +445,8 @@ func (this *ActivityCoAntroller) ScheduleList() {
 		conditionCount += ` AND art.yidong_activity_id = '' `
 	}
 	total, err := models.GetScheduleCount(conditionCount, uid)
-	page := paging.GetPaging(currentIndex, pageSize, total)
+	specialtotal, err := models.GetSpecialScheduleCount(uid)
+	page := paging.GetPaging(currentIndex, pageSize, total+specialtotal)
 	if err != nil {
 		br.Msg = "获取失败"
 		br.ErrMsg = "获取失败,Err:" + err.Error()

+ 13 - 0
models/activity.go

@@ -318,6 +318,19 @@ func GetActivityListByDateTime(startDate, endDate, activityIds, activityIdsLongT
 	return
 }
 
+//获取我的日程数量
+func GetSpecialScheduleCount(uid int) (count int, err error) {
+	o := orm.NewOrm()
+	sqlCount := `
+SELECT COUNT( 1 ) AS count FROM
+			cygx_activity_special AS art
+			INNER JOIN cygx_activity_special_trip AS my ON my.activity_id = art.activity_id 
+		WHERE
+			1 = 1 AND my.user_id = ? AND my.is_cancel = 0`
+	err = o.Raw(sqlCount, uid).QueryRow(&count)
+	return
+}
+
 //获取数量
 func GetActivityCount(condition string, playBack int, pars []interface{}, filter int) (count int, err error) {
 	var sqlJiontable string