Roc 1 сар өмнө
parent
commit
c4c2f2f426

+ 1 - 1
models/rag/question.go

@@ -103,7 +103,7 @@ func (m *Question) GetByCondition(condition string, pars []interface{}) (item *Q
 }
 
 func (m *Question) GetListByCondition(condition string, pars []interface{}, startSize, pageSize int) (items []*Question, err error) {
-	sqlStr := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s order by question_id asc LIMIT ?,?`, m.TableName(), condition)
+	sqlStr := fmt.Sprintf(`SELECT * FROM %s WHERE 1=1 %s order by question_id desc LIMIT ?,?`, m.TableName(), condition)
 	pars = append(pars, startSize, pageSize)
 	err = global.DbMap[utils.DbNameAI].Raw(sqlStr, pars...).Find(&items).Error