|
@@ -306,7 +306,7 @@ func (this *SupplyOrderApiController) UpdateSupply() {
|
306
|
306
|
items := item.(map[string]interface{})
|
307
|
307
|
items["is_first"] = 1
|
308
|
308
|
//如果电话和联系人都为空,不保存联系人
|
309
|
|
- if items["phone"] == "" && items["name"] == "" {
|
|
309
|
+ if items["phone"] == "" && items["name"] == nil {
|
310
|
310
|
upsupply := models.SpSupplierName{
|
311
|
311
|
ID: supplierid,
|
312
|
312
|
SupplierCode: supplierCode,
|
|
@@ -325,6 +325,10 @@ func (this *SupplyOrderApiController) UpdateSupply() {
|
325
|
325
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
326
|
326
|
return
|
327
|
327
|
}
|
|
328
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
329
|
+ "list": "保存成功",
|
|
330
|
+ })
|
|
331
|
+ return
|
328
|
332
|
}
|
329
|
333
|
}
|
330
|
334
|
}
|
|
@@ -608,7 +612,7 @@ func (this *SupplyOrderApiController) SaveSupply() {
|
608
|
612
|
items := item.(map[string]interface{})
|
609
|
613
|
items["is_first"] = 1
|
610
|
614
|
//如果电话和联系人都为空,不保存联系人
|
611
|
|
- if items["phone"] == "" && items["name"] == "" {
|
|
615
|
+ if items["phone"] == "" && items["name"] == nil {
|
612
|
616
|
supply := models.SpSupplierName{
|
613
|
617
|
SupplierCode: supplierCode,
|
614
|
618
|
SupplierName: supplierName,
|
|
@@ -629,6 +633,10 @@ func (this *SupplyOrderApiController) SaveSupply() {
|
629
|
633
|
this.ServeFailJsonSend(enums.ErrorCodeParamWrong, err.Error())
|
630
|
634
|
return
|
631
|
635
|
}
|
|
636
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
637
|
+ "list": "保存成功",
|
|
638
|
+ })
|
|
639
|
+ return
|
632
|
640
|
}
|
633
|
641
|
}
|
634
|
642
|
}
|