|
@@ -13,6 +13,8 @@ import (
|
|
|
"strings"
|
|
|
|
|
|
"github.com/go-xorm/xorm"
|
|
|
+ "go.mod/comm"
|
|
|
+ "go.mod/conf"
|
|
|
"go.mod/models"
|
|
|
"go.mod/web/viewmodels"
|
|
|
)
|
|
@@ -31,8 +33,13 @@ func NewTreeContractDao(engine *xorm.Engine) *TreeContractDao {
|
|
|
|
|
|
func (d *TreeContractDao) GetDetail(id int) *viewmodels.TreeSectionDetail {
|
|
|
data := &viewmodels.TreeSectionDetail{}
|
|
|
- _, _ = d.engine.Sql("select t.name, s.content from cm_tree_contracts as t left join cm_contracts as s on t.contract_id = s.id where t.id = ?", id).Get(data)
|
|
|
+ _, _ = d.engine.Sql("select t.name, s.content, f.ext, f.path, f.id as fid from cm_tree_contracts as t left join cm_contracts as s on t.contract_id = s.id left join cm_upload as f on t.contract_id = f.id where t.id = ?", id).Get(data)
|
|
|
+ fmt.Println(data)
|
|
|
+ if data.Fid != "" {
|
|
|
+ fid, _ := comm.AesEncrypt(data.Fid, conf.SignSecret)
|
|
|
+ data.Fid = fid
|
|
|
|
|
|
+ }
|
|
|
return data
|
|
|
}
|
|
|
|