XMLWAN пре 3 година
родитељ
комит
cf5d800fb5

+ 3 - 2
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go Прегледај датотеку

@@ -591,13 +591,14 @@ func (this *XcxApiController) GetDoctorAdvice() {
591 591
 	start_time := this.GetString("start_time")
592 592
 	end_time := this.GetString("end_time")
593 593
 	patient_id, _ := this.GetInt64("patient_id")
594
+	fmt.Println("patient_id", patient_id)
594 595
 	timeLayout := "2006-01-02"
595 596
 	loc, _ := time.LoadLocation("Local")
596 597
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
597 598
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
598
-	info, _ := service.GetXcxPatientInfo(patient_id)
599
+	info, _ := service.GetXcxPatientInfo(1)
599 600
 	config, _ := service.GetDoctorAdviceConfig(info.UserOrgId)
600
-
601
+	fmt.Println(startTime, endTime)
601 602
 	if config.IsOpenRemind == 0 || config.IsOpenRemind == 2 {
602 603
 
603 604
 		advice, _ := service.GetDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())

+ 2 - 2
service/xcx_mobile_api_service.go Прегледај датотеку

@@ -260,11 +260,11 @@ func GetEducationList(startime int64, endtime int64, patient_id int64) (treatmen
260 260
 func GetDoctorAdviceConfig(orgid int64) (models.XcxDoctorAdviceConfig, error) {
261 261
 
262 262
 	config := models.XcxDoctorAdviceConfig{}
263
-	err := XTReadDB().Model(&config).Where("org_id = ? and status = 1", orgid).Find(&config).Error
263
+	err := XTReadDB().Model(&config).Where("user_org_id = ? and status = 1", orgid).Find(&config).Error
264 264
 	return config, err
265 265
 }
266 266
 
267
-func GetDoctorAdvice(patient_id int64, startime int64, endtime int64) (advice []*models.XcxDoctorAdviceConfig, err error) {
267
+func GetDoctorAdvice(patient_id int64, startime int64, endtime int64) (advice []*models.XcxHisDoctorAdviceInfo, err error) {
268 268
 
269 269
 	err = XTReadDB().Where("patient_id = ? and advice_date >=? and advice_date<=? and status = 1", patient_id, startime, endtime).Find(&advice).Error
270 270
 	return advice, err