Procházet zdrojové kódy

供应商模块保存和更改接口改动

mainqaq před 3 roky
rodič
revize
bfd03ae0b8
1 změnil soubory, kde provedl 6 přidání a 5 odebrání
  1. 6 5
      service/supply_service.go

+ 6 - 5
service/supply_service.go Zobrazit soubor

3
 import (
3
 import (
4
 	"XT_New/models"
4
 	"XT_New/models"
5
 	"github.com/jinzhu/gorm"
5
 	"github.com/jinzhu/gorm"
6
-	"strconv"
7
 	"time"
6
 	"time"
8
 )
7
 )
9
 
8
 
53
 		items := item.(map[string]interface{})
52
 		items := item.(map[string]interface{})
54
 		//查询是否
53
 		//查询是否
55
 		if items["id"] == "" {
54
 		if items["id"] == "" {
56
-			items["id"] = "0"
55
+			var tmp float64 = 0
56
+			items["id"] = tmp
57
 		}
57
 		}
58
-		id, _ := strconv.ParseInt(items["id"].(string), 10, 64)
58
+		//id, _ := strconv.ParseInt(items["id"].(string), 10, 64)
59
+		id := int64(items["id"].(float64))
59
 		name := items["name"].(string)
60
 		name := items["name"].(string)
60
 		phone := items["phone"].(string)
61
 		phone := items["phone"].(string)
61
 		address := items["address"].(string)
62
 		address := items["address"].(string)
62
-		isfirst, _ := strconv.ParseInt(items["isfirst"].(string), 10, 64)
63
+		isfirst := int64(items["isfirst"].(int))
63
 		updatecontacts := models.SpSupplierContacts{
64
 		updatecontacts := models.SpSupplierContacts{
64
 			ID:           id,
65
 			ID:           id,
65
 			Name:         name,
66
 			Name:         name,
183
 		name := items["name"].(string)
184
 		name := items["name"].(string)
184
 		phone := items["phone"].(string)
185
 		phone := items["phone"].(string)
185
 		address := items["address"].(string)
186
 		address := items["address"].(string)
186
-		isfirst, _ := strconv.ParseInt(items["isfirst"].(string), 10, 64)
187
+		isfirst := int64(items["isfirst"].(int))
187
 
188
 
188
 		spcontacts := models.SpSupplierContacts{
189
 		spcontacts := models.SpSupplierContacts{
189
 			Name:         name,
190
 			Name:         name,