瀏覽代碼

用户停留时间优化

xingzai 3 年之前
父節點
當前提交
de00d6bb69
共有 4 個文件被更改,包括 8 次插入6 次删除
  1. 4 2
      controllers/article.go
  2. 1 1
      controllers/report.go
  3. 2 2
      models/tactics.go
  4. 1 1
      models/user.go

+ 4 - 2
controllers/article.go

@@ -467,8 +467,10 @@ func (this *ArticleController) AddStopTime() {
 	}
 
 	if stopTime == 0 {
-		br.ErrMsg = "时间错误"
-		return
+		stopTime = 1
+		//br.Msg = "时间格式错误"
+		//br.ErrMsg = "时间错误"
+		//return
 	}
 	detail := new(models.ArticleDetail)
 	hasPermission := 0

+ 1 - 1
controllers/report.go

@@ -55,7 +55,7 @@ func (this *ReportController) TradeList() {
 		count, err := models.CheckThisCategoryNewArticleIsRead(uid, v.CategoryId)
 		if err != nil {
 			br.Msg = "获取信息失败"
-			br.Msg = "获取帖子总数失败,Err:" + err.Error()
+			br.ErrMsg = "获取帖子总数失败,Err:" + err.Error()
 			return
 		}
 		if count == 0 && user.CreatedTime.Before(utils.StrTimeToTime(v.UpdateTime)) && utils.StrTimeToTime(utils.OnlineTime).Before(utils.StrTimeToTime(v.UpdateTime)) {

+ 2 - 2
models/tactics.go

@@ -90,7 +90,7 @@ func GetTacticsList2(endDate string) (list []*Tactics2, err error) {
 			INNER JOIN article_content AS b ON a.id=b.article_id
 			INNER JOIN article_category AS c ON a.id=c.article_id
 			INNER JOIN article_categoryinfo AS d ON c.category_id=d.id
-			WHERE a.publish_status=1  AND a.publish_date>=? AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,74,79,80,84,85,86,87,88,89,90,93,95,96,98) `
+			WHERE a.publish_status=1  AND a.publish_date>=? AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,72,74,79,80,84,85,86,87,88,89,90,93,95,96,98) `
 	//AND a.id NOT IN (3454,3456,3457,3459,2449,2450,2453,2454,2459,2530,2583,2663,2670,2699,2715,2732,2748,2759,2399,2356,2870,3173,2978,2826,3470) `
 	//IN(85,71)
 	_, err = o.Raw(sql, endDate).QueryRows(&list)
@@ -105,7 +105,7 @@ func GetTacticsListAll2() (list []*Tactics2, err error) {
 			INNER JOIN article_content AS b ON a.id=b.article_id
 			INNER JOIN article_category AS c ON a.id=c.article_id
 			INNER JOIN article_categoryinfo AS d ON c.category_id=d.id
-			WHERE a.publish_status=1  AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,74,79,80,84,85,86,87,88,89,90,93,95,96,98) `
+			WHERE a.publish_status=1  AND d.id IN (7,9,11,28,32,45,51,52,57,62,64,65,66,67,69,71,72,74,79,80,84,85,86,87,88,89,90,93,95,96,98) `
 	//AND a.id NOT IN (3454,3456,3457,3459,2449,2450,2453,2454,2459,2530,2583,2663,2670,2699,2715,2732,2748,2759,2399,2356,2870,3173,2978,2826,3470) `
 	//IN(85,71)
 	_, err = o.Raw(sql).QueryRows(&list)

+ 1 - 1
models/user.go

@@ -177,7 +177,7 @@ func GetArticleUserBrowseHistoryCount(userId int, endDate string) (count int, er
 func GetArticleUserBrowseHistoryList(startSize, pageSize, userId int, endDate string) (items []*ArticleInterviewApplyList, err error) {
 	sql := `SELECT a.* FROM cygx_article_history_record AS a
 			WHERE a.user_id=? AND a.create_time>=?  GROUP BY a.article_id
-           ORDER BY a.modify_time DESC LIMIT ?,? `
+           ORDER BY a.id DESC LIMIT ?,? `
 	_, err = orm.NewOrm().Raw(sql, userId, endDate, startSize, pageSize).QueryRows(&items)
 	return
 }