瀏覽代碼

Merge branch 'ETA_1.8.8' into debug

zwxi 8 月之前
父節點
當前提交
73b8e233e6
共有 3 個文件被更改,包括 10 次插入4 次删除
  1. 7 0
      controllers/ai/ai_summary.go
  2. 2 2
      models/ai_summary/ai_pormpt.go
  3. 1 2
      models/ai_summary/ai_summary_classify.go

+ 7 - 0
controllers/ai/ai_summary.go

@@ -9,6 +9,7 @@ import (
 	"eta/eta_api/utils"
 	"fmt"
 	"github.com/rdlucklib/rdluck_tools/paging"
+	"strconv"
 	"time"
 )
 
@@ -52,6 +53,9 @@ func (this *AiController) AiSummaryClassifyItems() {
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 	}
+	for k := range rootList {
+		rootList[k].UniqueCode = strconv.Itoa(rootList[k].AiSummaryClassifyId) + "_" + strconv.Itoa(rootList[k].AiSummaryId)
+	}
 
 	classifyAll, err := ai_summary.GetAiSummaryClassifyAndInfoByParentId(aiSummaryClassifyId)
 	if err != nil && err.Error() != utils.ErrNoRow() {
@@ -59,6 +63,9 @@ func (this *AiController) AiSummaryClassifyItems() {
 		br.ErrMsg = "获取数据失败,Err:" + err.Error()
 		return
 	}
+	for k := range classifyAll {
+		classifyAll[k].UniqueCode = strconv.Itoa(classifyAll[k].AiSummaryClassifyId) + "_" + strconv.Itoa(classifyAll[k].AiSummaryId)
+	}
 
 	nodeAll := make([]*ai_summary.AiSummaryClassifyItems, 0)
 	for k := range rootList {

+ 2 - 2
models/ai_summary/ai_pormpt.go

@@ -32,9 +32,9 @@ type AiPromptItem struct {
 func GetAiPromptList(sysUserId, isShare int) (items []*AiPromptItem, err error) {
 	sql := ``
 	if isShare == 1 {
-		sql = ` SELECT * FROM ai_prompt WHERE sys_admin_id=? and is_share=1 ORDER BY create_time DESC `
+		sql = ` SELECT * FROM ai_prompt WHERE sys_admin_id=? and is_share=1 ORDER BY sort  `
 	} else {
-		sql = ` SELECT * FROM ai_prompt WHERE sys_admin_id=? ORDER BY create_time DESC `
+		sql = ` SELECT * FROM ai_prompt WHERE sys_admin_id=? ORDER BY sort  `
 	}
 	o := orm.NewOrm()
 	_, err = o.Raw(sql, sysUserId).QueryRows(&items)

+ 1 - 2
models/ai_summary/ai_summary_classify.go

@@ -39,6 +39,7 @@ type AiSummaryClassifyItems struct {
 	Level               int       `description:"层级"`
 	Sort                int       `description:"排序字段,越小越靠前,默认值:10"`
 	AiSummaryId         int       `description:"纪要id"`
+	UniqueCode          string    `description:"唯一编码"`
 	Children            []*AiSummaryClassifyItems
 }
 
@@ -268,7 +269,6 @@ WHERE
 	return
 }
 
-
 func GetAiSummaryAllParentByClassifyId(aiSummaryClassifyId int) (ids string, err error) {
 	o := orm.NewOrm()
 	sql := `SELECT
@@ -306,7 +306,6 @@ WHERE
 	return
 }
 
-
 type AiSummaryListResp struct {
 	Paging *paging.PagingItem
 	List   []*AiSummaryItems