瀏覽代碼

体积小

XMLWAN 3 年之前
父節點
當前提交
c7d6b538c1
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      service/xcx_mobile_api_service.go

+ 3 - 3
service/xcx_mobile_api_service.go 查看文件

130
 func GetMobilePatient(mobile string, idcard string) (*models.XcxPatients, error) {
130
 func GetMobilePatient(mobile string, idcard string) (*models.XcxPatients, error) {
131
 
131
 
132
 	patient := models.XcxPatients{}
132
 	patient := models.XcxPatients{}
133
-	err := XTReadDB().Model(&patient).Where("(phone = ? or relative_phone =?) and id_card_no =?", mobile, mobile, idcard).Find(&patient).Error
134
-	//err := XTReadDB().Model(&patient).Where("id_card_no = ? and status = 1", mobile).Find(&patient).Error
133
+	err := XTReadDB().Model(&patient).Where("(phone = ? or relative_phone =?) and id_card_no = ?", mobile, mobile, idcard).Find(&patient).Error
134
+
135
 	if err == gorm.ErrRecordNotFound {
135
 	if err == gorm.ErrRecordNotFound {
136
 		return nil, err
136
 		return nil, err
137
 	}
137
 	}
153
 func GetMobilePatientOne(mobile string) (*models.XcxAdminUserRole, error) {
153
 func GetMobilePatientOne(mobile string) (*models.XcxAdminUserRole, error) {
154
 
154
 
155
 	patient := models.XcxAdminUserRole{}
155
 	patient := models.XcxAdminUserRole{}
156
-	err := XTReadDB().Model(&patient).Where("mobile = ? and status = 1", mobile).Find(&patient).Error
156
+	err := UserReadDB().Model(&patient).Where("mobile = ? and status = 1", mobile).Find(&patient).Error
157
 	if err == gorm.ErrRecordNotFound {
157
 	if err == gorm.ErrRecordNotFound {
158
 		return nil, err
158
 		return nil, err
159
 	}
159
 	}