Browse Source

体积小

XMLWAN 3 years ago
parent
commit
cf5d800fb5

+ 3 - 2
controllers/xcx_mobile_api_controller.go/xcx_api_controller.go View File

591
 	start_time := this.GetString("start_time")
591
 	start_time := this.GetString("start_time")
592
 	end_time := this.GetString("end_time")
592
 	end_time := this.GetString("end_time")
593
 	patient_id, _ := this.GetInt64("patient_id")
593
 	patient_id, _ := this.GetInt64("patient_id")
594
+	fmt.Println("patient_id", patient_id)
594
 	timeLayout := "2006-01-02"
595
 	timeLayout := "2006-01-02"
595
 	loc, _ := time.LoadLocation("Local")
596
 	loc, _ := time.LoadLocation("Local")
596
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
597
 	startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
597
 	endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
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
 	config, _ := service.GetDoctorAdviceConfig(info.UserOrgId)
600
 	config, _ := service.GetDoctorAdviceConfig(info.UserOrgId)
600
-
601
+	fmt.Println(startTime, endTime)
601
 	if config.IsOpenRemind == 0 || config.IsOpenRemind == 2 {
602
 	if config.IsOpenRemind == 0 || config.IsOpenRemind == 2 {
602
 
603
 
603
 		advice, _ := service.GetDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())
604
 		advice, _ := service.GetDoctorAdvice(patient_id, startTime.Unix(), endTime.Unix())

+ 2 - 2
service/xcx_mobile_api_service.go View File

260
 func GetDoctorAdviceConfig(orgid int64) (models.XcxDoctorAdviceConfig, error) {
260
 func GetDoctorAdviceConfig(orgid int64) (models.XcxDoctorAdviceConfig, error) {
261
 
261
 
262
 	config := models.XcxDoctorAdviceConfig{}
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
 	return config, err
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
 	err = XTReadDB().Where("patient_id = ? and advice_date >=? and advice_date<=? and status = 1", patient_id, startime, endtime).Find(&advice).Error
269
 	err = XTReadDB().Where("patient_id = ? and advice_date >=? and advice_date<=? and status = 1", patient_id, startime, endtime).Find(&advice).Error
270
 	return advice, err
270
 	return advice, err