Browse Source

体积小

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

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

136
 }
136
 }
137
 
137
 
138
 func (this *XcxApiController) GetLoginInfor() {
138
 func (this *XcxApiController) GetLoginInfor() {
139
-	fmt.Println("c出啊大发阿方阿道夫发 阿方阿")
139
+
140
 	mobile := this.GetString("mobile")
140
 	mobile := this.GetString("mobile")
141
 	fmt.Println(mobile)
141
 	fmt.Println(mobile)
142
-	info, err := service.GetMobilePatientInfo(mobile)
142
+	info, _ := service.GetMobilePatientInfo("18179463966")
143
 	if info.ID == 0 {
143
 	if info.ID == 0 {
144
-		if err != nil {
145
-			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
146
-			return
147
-		}
148
 
144
 
149
 		this.ServeSuccessJSON(map[string]interface{}{
145
 		this.ServeSuccessJSON(map[string]interface{}{
150
 			"is_bind": false,
146
 			"is_bind": false,
151
 			"info":    info,
147
 			"info":    info,
152
 		})
148
 		})
153
 	} else {
149
 	} else {
154
-		_, errcode := service.GetLoginInfor("18923081560")
150
+		_, errcode := service.GetLoginInfor("18179463966")
155
 		if errcode == gorm.ErrRecordNotFound {
151
 		if errcode == gorm.ErrRecordNotFound {
156
 			role := models.XcxAdminUserRole{
152
 			role := models.XcxAdminUserRole{
157
 				PatientName: info.Name,
153
 				PatientName: info.Name,
223
 
219
 
224
 func (this *XcxApiController) GetScheduleInfo() {
220
 func (this *XcxApiController) GetScheduleInfo() {
225
 	patient_id, _ := this.GetInt64("patient_id")
221
 	patient_id, _ := this.GetInt64("patient_id")
222
+	fmt.Println(patient_id)
226
 	thisWeekMonday := service.GetFirstDateOfWeek()
223
 	thisWeekMonday := service.GetFirstDateOfWeek()
227
 	weekDayWeek := service.GetWeekDayOfWeek()
224
 	weekDayWeek := service.GetWeekDayOfWeek()
228
 	TimeMonday, _ := time.Parse("2006-01-02", thisWeekMonday)
225
 	TimeMonday, _ := time.Parse("2006-01-02", thisWeekMonday)
234
 	fmt.Println("weekmodonday", weekMonday)
231
 	fmt.Println("weekmodonday", weekMonday)
235
 	fmt.Println("nextweeekday", weekDay)
232
 	fmt.Println("nextweeekday", weekDay)
236
 
233
 
237
-	timeLayout := "2006-01-02 15:04:05"
234
+	timeLayout := "2006-01-02"
238
 	loc, _ := time.LoadLocation("Local")
235
 	loc, _ := time.LoadLocation("Local")
239
-
240
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", weekMonday+" 00:00:00", loc)
236
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", weekMonday+" 00:00:00", loc)
237
+	//startTime, _ := time.ParseInLocation(timeLayout+"15:04:05", weekMonday+"00:00:00", loc)
241
 	fmt.Println("startiem", startTime)
238
 	fmt.Println("startiem", startTime)
242
-	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", weekDay+" 00:00:00", loc)
239
+	endTime, _ := time.ParseInLocation(timeLayout+"15:04:05", weekDay+"00:00:00", loc)
243
 
240
 
244
 	fmt.Println(startTime.Unix(), endTime.Unix())
241
 	fmt.Println(startTime.Unix(), endTime.Unix())
245
 
242
 
246
-	schedule, err := service.GetScheduleInfo(1630252800, 1631980800, patient_id)
243
+	schedule, err := service.GetScheduleInfo(startTime.Unix(), endTime.Unix(), 1)
247
 	if err != nil {
244
 	if err != nil {
248
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
245
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
249
 		return
246
 		return