wangfei 6 years ago
parent
commit
0f21e6d4ce
2 changed files with 4 additions and 1 deletions
  1. 1
    1
      models/message/location.go
  2. 3
    0
      service/message/location.go

+ 1
- 1
models/message/location.go View File

25
 // GetLocationMaxSort 获取最大的位置
25
 // GetLocationMaxSort 获取最大的位置
26
 func (m *MessageDAO) GetLocationMaxSort(issys, org_id string) (int, error) {
26
 func (m *MessageDAO) GetLocationMaxSort(issys, org_id string) (int, error) {
27
 	var location []map[string][]byte
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
 	location, err := m.db.Query(sql)
29
 	location, err := m.db.Query(sql)
30
 	if err != nil {
30
 	if err != nil {
31
 		return 0, err
31
 		return 0, err

+ 3
- 0
service/message/location.go View File

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