Browse Source

体积小

XMLWAN 3 years ago
parent
commit
15c5a8da9b

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

65
 	//用户绑定
65
 	//用户绑定
66
 	name := this.GetString("name")
66
 	name := this.GetString("name")
67
 	id_card_no := this.GetString("id_card_no")
67
 	id_card_no := this.GetString("id_card_no")
68
+	fmt.Println("id_card_no", id_card_no)
68
 	mobile := this.GetString("mobile")
69
 	mobile := this.GetString("mobile")
69
 	code := this.GetString("code")
70
 	code := this.GetString("code")
70
-
71
 	patient, errcodes := service.GetMobilePatient(id_card_no)
71
 	patient, errcodes := service.GetMobilePatient(id_card_no)
72
 	if errcodes == gorm.ErrRecordNotFound {
72
 	if errcodes == gorm.ErrRecordNotFound {
73
 		role := models.XcxAdminUserRole{
73
 		role := models.XcxAdminUserRole{
243
 	endTime, _ := time.ParseInLocation(timeLayout+"15:04:05", weekDay+"00:00:00", loc)
243
 	endTime, _ := time.ParseInLocation(timeLayout+"15:04:05", weekDay+"00:00:00", loc)
244
 	fmt.Println(startTime.Unix(), endTime.Unix())
244
 	fmt.Println(startTime.Unix(), endTime.Unix())
245
 	schedule, err := service.GetScheduleInfo(startTime.Unix(), endTime.Unix(), 1)
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
 	if err != nil {
251
 	if err != nil {
247
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
252
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
248
 		return
253
 		return
249
 	}
254
 	}
255
+
250
 	var one = startTime.Unix() + 86400
256
 	var one = startTime.Unix() + 86400
251
 	fmt.Println("one2322332", one)
257
 	fmt.Println("one2322332", one)
252
 	var two = one + 86400
258
 	var two = one + 86400

+ 1 - 1
service/xcx_mobile_api_service.go View File

131
 
131
 
132
 	patient := models.XcxPatients{}
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
 	if err == gorm.ErrRecordNotFound {
135
 	if err == gorm.ErrRecordNotFound {
136
 		return nil, err
136
 		return nil, err
137
 	}
137
 	}