소스 검색

최근 토론 기능 추가

https://github.com/openNAMU/openNAMU/issues/2134
잉여개발기 (SPDV) 2 년 전
부모
커밋
51c8a5c7f0

BIN
route_go/bin/main.amd64.bin


BIN
route_go/bin/main.amd64.exe


BIN
route_go/bin/main.arm64.bin


BIN
route_go/bin/main.arm64.exe


+ 5 - 3
route_go/route/api_list_recent_discuss.go

@@ -39,7 +39,7 @@ func Api_list_recent_discuss(call_arg []string) {
 	} else if set_type == "close" {
 		stmt, err = db.Prepare(tool.DB_change(db_set, "select title, sub, date, code, stop from rd where stop = 'O' order by date desc limit ?"))
 	} else {
-		stmt, err = db.Prepare(tool.DB_change(db_set, "select title, sub, date, code, stop from rd where stop != 'O' order by date asc limit ?"))
+		stmt, err = db.Prepare(tool.DB_change(db_set, "select title, sub, date, code, stop from rd where stop != 'O' order by date desc limit ?"))
 	}
 
 	if err != nil {
@@ -68,15 +68,16 @@ func Api_list_recent_discuss(call_arg []string) {
 			log.Fatal(err)
 		}
 
-		stmt, err := db.Prepare(tool.DB_change(db_set, "select ip from topic where code = ? order by id + 0 desc limit 1"))
+		stmt, err := db.Prepare(tool.DB_change(db_set, "select ip, id from topic where code = ? order by id + 0 desc limit 1"))
 		if err != nil {
 			log.Fatal(err)
 		}
 		defer stmt.Close()
 
 		var ip string
+		var id string
 
-		err = stmt.QueryRow(code).Scan(&ip)
+		err = stmt.QueryRow(code).Scan(&ip, &id)
 		if err != nil {
 			if err == sql.ErrNoRows {
 				ip = ""
@@ -106,6 +107,7 @@ func Api_list_recent_discuss(call_arg []string) {
 			stop,
 			ip_pre,
 			ip_render,
+			id,
 		})
 	}
 

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.5.0-dev71",
+        "r_ver" : "v3.5.0-dev72",
         "c_ver" : "3500376",
         "s_ver" : "3500113"
     }

+ 3 - 1
views/main_css/js/route/list_recent_discuss.js

@@ -37,7 +37,9 @@ function opennamu_list_recent_discuss(tool = 'normal') {
 
                 data_html += '<div style="float: right;">';
 
-                data_html += data[for_a][6];
+                data_html += '<a href="/thread/' + data[for_a][3] + '#' + data[for_a][7] + '">#' + data[for_a][7] + '</a> | ';
+                data_html += data[for_a][6] + ' | ';
+                data_html += data[for_a][2];
 
                 data_html += '</div>';
                 data_html += '<div style="clear: both;"></div>';