Browse Source

体积小

XMLWAN 3 years ago
parent
commit
0bccde3016

+ 3 - 3
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

122
 
122
 
123
 func (this *XcxApiController) GetLoginInfor() {
123
 func (this *XcxApiController) GetLoginInfor() {
124
 	fmt.Println("c出啊大发阿方阿道夫发 阿方阿")
124
 	fmt.Println("c出啊大发阿方阿道夫发 阿方阿")
125
-	//mobile := this.GetString("mobile")
126
-	//fmt.Println(mobile)
127
-	info, err := service.GetMobilePatientInfo("18923081560")
125
+	mobile := this.GetString("mobile")
126
+	fmt.Println(mobile)
127
+	info, err := service.GetMobilePatientInfo(mobile)
128
 	if info.ID == 0 {
128
 	if info.ID == 0 {
129
 		if err == nil {
129
 		if err == nil {
130
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
130
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)

+ 9 - 9
service/xcx_mobile_api_service.go View File

31
 	return role, err
31
 	return role, err
32
 }
32
 }
33
 
33
 
34
-func GetMobilePatientInfo(mobile string) (*models.XcxPatients, error) {
34
+func GetMobilePatientInfo(mobile string) (models.XcxPatients, error) {
35
 
35
 
36
 	patients := models.XcxPatients{}
36
 	patients := models.XcxPatients{}
37
 	err := XTReadDB().Model(&patients).Where("(phone = ? or home_telephone = ? ) and status = 1", mobile, mobile).Find(&patients).Error
37
 	err := XTReadDB().Model(&patients).Where("(phone = ? or home_telephone = ? ) and status = 1", mobile, mobile).Find(&patients).Error
38
-	if err == gorm.ErrRecordNotFound {
39
-		return nil, err
40
-	}
41
-
42
-	if err != nil {
43
-		return nil, err
44
-	}
45
-	return &patients, nil
38
+	//if err == gorm.ErrRecordNotFound {
39
+	//	return nil, err
40
+	//}
41
+	//
42
+	//if err != nil {
43
+	//	return nil, err
44
+	//}
45
+	return patients, err
46
 }
46
 }