Browse Source

体积小

XMLWAN 3 years ago
parent
commit
f231511a40
1 changed files with 10 additions and 8 deletions
  1. 10 8
      controllers/xcx_mobile_api_controller.go/xcx_api_controller.go

+ 10 - 8
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

71
 	fmt.Println("id_card_no", id_card_no)
71
 	fmt.Println("id_card_no", id_card_no)
72
 	mobile := this.GetString("mobile")
72
 	mobile := this.GetString("mobile")
73
 	code := this.GetString("code")
73
 	code := this.GetString("code")
74
-	patient, errcodes := service.GetMobilePatient(id_card_no)
75
-	if errcodes == gorm.ErrRecordNotFound {
74
+	patient, errcodes := service.GetMobilePatient("420983197011169574")
75
+	fmt.Println("errcodes2323232232", errcodes)
76
+	if errcodes == nil {
76
 		role := models.XcxAdminUserRole{
77
 		role := models.XcxAdminUserRole{
77
 			PatientName: name,
78
 			PatientName: name,
78
 			IdCardNo:    id_card_no,
79
 			IdCardNo:    id_card_no,
101
 					"msg":     "绑定失败",
102
 					"msg":     "绑定失败",
102
 				})
103
 				})
103
 			}
104
 			}
105
+			mobilePatient, _ := service.GetMobilePatient(id_card_no)
104
 			this.ServeSuccessJSON(map[string]interface{}{
106
 			this.ServeSuccessJSON(map[string]interface{}{
105
-				"role": role,
107
+				"role":          role,
108
+				"mobilePatient": mobilePatient,
106
 			})
109
 			})
107
 
110
 
108
-		} else if errcode == nil {
109
-			mobilePatient, _ := service.GetMobilePatient(id_card_no)
111
+		} else if errcode == gorm.ErrRecordNotFound {
112
+
110
 			this.ServeSuccessJSON(map[string]interface{}{
113
 			this.ServeSuccessJSON(map[string]interface{}{
111
-				"is_bind": true,
112
-				"patient": mobilePatient,
114
+				"is_bind": false,
113
 			})
115
 			})
114
 		}
116
 		}
115
 
117
 
163
 	this.ServeSuccessJSON(map[string]interface{}{
165
 	this.ServeSuccessJSON(map[string]interface{}{
164
 		"patient": info,
166
 		"patient": info,
165
 		"role":    user_admin,
167
 		"role":    user_admin,
166
-		"is_bind": "true",
168
+		"is_bind": true,
167
 	})
169
 	})
168
 }
170
 }
169
 
171