Browse Source

体积小

XMLWAN 3 years ago
parent
commit
fe5fad57cb
1 changed files with 5 additions and 7 deletions
  1. 5 7
      controllers/xcx_mobile_api_controller.go/xcx_api_controller.go

+ 5 - 7
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

102
 					"msg":     "绑定失败",
102
 					"msg":     "绑定失败",
103
 				})
103
 				})
104
 			}
104
 			}
105
-			mobilePatient, _ := service.GetMobilePatient(id_card_no)
106
 			this.ServeSuccessJSON(map[string]interface{}{
105
 			this.ServeSuccessJSON(map[string]interface{}{
107
-				"role":          role,
108
-				"mobilePatient": mobilePatient,
106
+				"role": role,
109
 			})
107
 			})
110
 
108
 
111
 		} else if errcode == gorm.ErrRecordNotFound {
109
 		} else if errcode == gorm.ErrRecordNotFound {
112
-
110
+			mobilePatient, _ := service.GetMobilePatient(id_card_no)
113
 			this.ServeSuccessJSON(map[string]interface{}{
111
 			this.ServeSuccessJSON(map[string]interface{}{
114
-				"is_bind": false,
112
+				"is_bind": true,
113
+				"patient": mobilePatient,
115
 			})
114
 			})
116
 		}
115
 		}
117
 
116
 
118
 		fmt.Println("roler", role)
117
 		fmt.Println("roler", role)
119
-	} else if errcodes == nil {
118
+	} else if errcodes == gorm.ErrRecordNotFound {
120
 		this.ServeSuccessJSON(map[string]interface{}{
119
 		this.ServeSuccessJSON(map[string]interface{}{
121
 			"is_bind": false,
120
 			"is_bind": false,
122
-			"patient": patient,
123
 		})
121
 		})
124
 	}
122
 	}
125
 
123