|
@@ -21,6 +21,7 @@ type CygxPageHistoryRecord struct {
|
|
|
Router string `description:"路由"`
|
|
|
PageRouter string `description:"前端页面路径"`
|
|
|
Parameter string `description:"参数"`
|
|
|
+ RegisterPlatform int `description:"来源 1小程序,2:网页"`
|
|
|
}
|
|
|
|
|
|
type CygxPageHistoryRecordRep struct {
|
|
@@ -40,7 +41,7 @@ type CygxPageHistoryRecordHtgjRep struct {
|
|
|
Sign string `description:"签名"`
|
|
|
}
|
|
|
|
|
|
-//添加
|
|
|
+// 添加
|
|
|
func AddCygxPageHistoryRecord(item *CygxPageHistoryRecord) (lastId int64, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
lastId, err = o.Insert(item)
|
|
@@ -53,14 +54,14 @@ type PageRouter struct {
|
|
|
|
|
|
func GetTimeLineRecordCount(userId, industrialManagementId int) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
- sql := `SELECT COUNT(1) AS count FROM cygx_page_history_record WHERE user_id=? AND router = '/api/report/industry/ArticleList?PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=`+strconv.Itoa(industrialManagementId)+`'`
|
|
|
+ sql := `SELECT COUNT(1) AS count FROM cygx_page_history_record WHERE user_id=? AND router = '/api/report/industry/ArticleList?PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=` + strconv.Itoa(industrialManagementId) + `'`
|
|
|
err = o.Raw(sql, userId).QueryRow(&count)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
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,1 `
|
|
|
+ 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,1 `
|
|
|
err = o.Raw(sql, userId).QueryRow(&item)
|
|
|
return
|
|
|
}
|
|
@@ -70,4 +71,4 @@ func GetTimeLineRecordAllCount(userId int, date string) (items []*CygxPageHistor
|
|
|
sql := `SELECT * FROM cygx_page_history_record WHERE user_id=? AND router LIKE '%/api/report/industry/ArticleList?PageSize=10&CurrentIndex=1&CategoryId=99999&IndustrialManagementId=%' AND create_time > ? `
|
|
|
_, err = o.Raw(sql, userId, date).QueryRows(&items)
|
|
|
return
|
|
|
-}
|
|
|
+}
|