wangfei 6 vuotta sitten
vanhempi
commit
0f21e6d4ce
2 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 1
    1
      models/message/location.go
  2. 3
    0
      service/message/location.go

+ 1
- 1
models/message/location.go Näytä tiedosto

@@ -25,7 +25,7 @@ func (m *MessageDAO) GetLocationList(issys, org_id string) ([]model.TdCmsImageLo
25 25
 // GetLocationMaxSort 获取最大的位置
26 26
 func (m *MessageDAO) GetLocationMaxSort(issys, org_id string) (int, error) {
27 27
 	var location []map[string][]byte
28
-	sql := `select max(order_no) as order_no from td_cms_image_location where issys=` + issys + ` and org_id ='` + org_id + `'`
28
+	sql := `select max(order_no) as order_no from td_cms_image_location where is_sys=` + issys + ` and org_id ='` + org_id + `'`
29 29
 	location, err := m.db.Query(sql)
30 30
 	if err != nil {
31 31
 		return 0, err

+ 3
- 0
service/message/location.go Näytä tiedosto

@@ -4,6 +4,8 @@ import (
4 4
 	"spaceofcheng/services/models/model"
5 5
 	"spaceofcheng/services/utils"
6 6
 	"strings"
7
+
8
+	"github.com/astaxie/beego"
7 9
 )
8 10
 
9 11
 // GetLocationList 获取列表
@@ -23,6 +25,7 @@ func (s *MessageServ) SaveLocation(location model.TdCmsImageLocation) (*model.Td
23 25
 	if location.LocationId == "" {
24 26
 		sort, err := s.dao.GetLocationMaxSort("0", location.OrgId)
25 27
 		if err != nil {
28
+			beego.Error(err)
26 29
 			return nil, err
27 30
 		}
28 31
 		location.OrderNo = sort