XMLWAN 3 лет назад
Родитель
Сommit
15c5a8da9b

+ 7 - 1
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go Просмотреть файл

@@ -65,9 +65,9 @@ func (this *XcxApiController) GetUserRegister() {
65 65
 	//用户绑定
66 66
 	name := this.GetString("name")
67 67
 	id_card_no := this.GetString("id_card_no")
68
+	fmt.Println("id_card_no", id_card_no)
68 69
 	mobile := this.GetString("mobile")
69 70
 	code := this.GetString("code")
70
-
71 71
 	patient, errcodes := service.GetMobilePatient(id_card_no)
72 72
 	if errcodes == gorm.ErrRecordNotFound {
73 73
 		role := models.XcxAdminUserRole{
@@ -243,10 +243,16 @@ func (this *XcxApiController) GetScheduleInfo() {
243 243
 	endTime, _ := time.ParseInLocation(timeLayout+"15:04:05", weekDay+"00:00:00", loc)
244 244
 	fmt.Println(startTime.Unix(), endTime.Unix())
245 245
 	schedule, err := service.GetScheduleInfo(startTime.Unix(), endTime.Unix(), 1)
246
+
247
+	//获取当前今日的排班日期
248
+	time_now := time.Now().Format("2006-01-02")
249
+	fmt.Println("time_now", time_now)
250
+
246 251
 	if err != nil {
247 252
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
248 253
 		return
249 254
 	}
255
+
250 256
 	var one = startTime.Unix() + 86400
251 257
 	fmt.Println("one2322332", one)
252 258
 	var two = one + 86400

+ 1 - 1
service/xcx_mobile_api_service.go Просмотреть файл

@@ -131,7 +131,7 @@ func GetMobilePatient(mobile string) (*models.XcxPatients, error) {
131 131
 
132 132
 	patient := models.XcxPatients{}
133 133
 
134
-	err := UserReadDB().Model(&patient).Where("id_card_no = ? and status = 1", mobile).Find(&patient).Error
134
+	err := XTReadDB().Model(&patient).Where("id_card_no = ? and status = 1", mobile).Find(&patient).Error
135 135
 	if err == gorm.ErrRecordNotFound {
136 136
 		return nil, err
137 137
 	}