fix: 【光环助手V5.14.0】数据后台—搜索词统计 https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/2057

This commit is contained in:
张玉久
2022-09-14 17:24:13 +08:00
parent c6dbd167c9
commit cdfda0d175
2 changed files with 6 additions and 4 deletions

View File

@ -367,10 +367,11 @@ object NewFlatLogUtils {
//社区搜索结果浏览
@JvmStatic
fun logViewSearchList(stayTime: Long) {
fun logViewSearchList(stayTime: Long, searchKey: String) {
val json = json {
"event" to "view_search_list"
"stay_time" to stayTime
"search_key" to searchKey
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
@ -401,10 +402,11 @@ object NewFlatLogUtils {
//论坛搜索结果浏览
@JvmStatic
fun logViewBbsSearchList(stayTime: Long) {
fun logViewBbsSearchList(stayTime: Long, searchKey: String) {
val json = json {
"event" to "view_bbs_search_list"
"stay_time" to stayTime
"search_key" to searchKey
parseAndPutMeta().invoke(this)
}
log(json, "event", false)

View File

@ -94,9 +94,9 @@ class ForumOrUserSearchActivity : SearchActivity() {
if (key.isNotEmpty()) {
val stayTime = (System.currentTimeMillis() - startPageTime) / 1000
if (mEntrance == "论坛首页") {
NewFlatLogUtils.logViewSearchList(stayTime)
NewFlatLogUtils.logViewSearchList(stayTime, key)
} else {
NewFlatLogUtils.logViewBbsSearchList(stayTime)
NewFlatLogUtils.logViewBbsSearchList(stayTime, key)
}
}
}