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

Merge branch 'cygx_9.2' into debug

ziwen пре 2 година
родитељ
комит
9220832a70
2 измењених фајлова са 4 додато и 4 уклоњено
  1. 2 2
      controllers/report.go
  2. 2 2
      models/page_history_record.go

+ 2 - 2
controllers/report.go

@@ -393,7 +393,7 @@ func (this *ReportController) ArticleCategoryList() {
 		}
 		var recordItem *models.CygxPageHistoryRecord
 		if count > 0 {
-			recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId, time.Now().Format(utils.FormatDate))
+			recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
 			if err != nil {
 				br.Msg = "查询浏览记录失败"
 				br.ErrMsg = "查询浏览记录失败,Err:" + err.Error()
@@ -668,7 +668,7 @@ func (this *ReportController) List() {
 		}
 		var recordItem *models.CygxPageHistoryRecord
 		if count > 0 {
-			recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId, time.Now().Format(utils.FormatDate))
+			recordItem, err = models.GetTimeLineRecordItem(user.UserId, industrialManagementId)
 			if err != nil {
 				br.Msg = "查询浏览记录失败"
 				br.ErrMsg = "查询浏览记录失败,Err:" + err.Error()

+ 2 - 2
models/page_history_record.go

@@ -58,9 +58,9 @@ func GetTimeLineRecordCount(userId, industrialManagementId int, date string) (co
 	return
 }
 
-func GetTimeLineRecordItem(userId, industrialManagementId int, date string) (item *CygxPageHistoryRecord, err error) {
+func GetTimeLineRecordItem(userId, industrialManagementId int) (item *CygxPageHistoryRecord, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT * FROM cygx_page_history_record WHERE user_id=? AND router = '/api/report/industry/ArticleList?PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=`+strconv.Itoa(industrialManagementId)+ `' ORDER BY create_time DESC LIMIT 1 `
-	err = o.Raw(sql, userId, date).QueryRow(&item)
+	err = o.Raw(sql, userId).QueryRow(&item)
 	return
 }