Ver código fonte

耗材参数

XMLWAN 3 anos atrás
pai
commit
d3cac6f198

+ 16 - 7
controllers/mobile_api_controllers/dialysis_api_controller.go Ver arquivo

@@ -3080,12 +3080,12 @@ func (c *DialysisAPIController) GetSchedule() {
3080 3080
 }
3081 3081
 
3082 3082
 func (c *DialysisAPIController) GetPatientId() {
3083
+
3083 3084
 	id, _ := c.GetInt64("id")
3084
-	fmt.Println("id223333444444", id)
3085
+
3085 3086
 	patientId, _ := service.GetPatientId(id)
3086 3087
 	//获取该患者的所有传染病
3087
-	list, err := service.GetPatientInfectious(id)
3088
-	fmt.Println("err222222222", err)
3088
+	list, _ := service.GetPatientInfectious(id)
3089 3089
 	c.ServeSuccessJSON(map[string]interface{}{
3090 3090
 		"patient":       patientId,
3091 3091
 		"infectioulist": list,
@@ -4649,9 +4649,18 @@ func (c *DialysisAPIController) GetPatientDialysisRecord() {
4649 4649
 
4650 4650
 	id, _ := c.GetInt64("id")
4651 4651
 	fmt.Println(id)
4652
-	start_time := time.Now().Format("2006-01-02 15:04")
4653
-	fmt.Println("stat", start_time)
4652
+	timeLayout := "2006-01-02"
4653
+	loc, _ := time.LoadLocation("Local")
4654
+	start_time := time.Now().Format("2006-01-02")
4655
+	startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
4654 4656
 	nowTime := time.Now()
4655
-	endTime := nowTime.AddDate(-2, 0, 0)
4656
-	fmt.Println(endTime)
4657
+	endTime := nowTime.AddDate(-1, 0, 0)
4658
+	endTimes := endTime.Format("2006-01-02")
4659
+	endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", endTimes+" 00:00:00", loc)
4660
+	adminUserInfo := c.GetAdminUserInfo()
4661
+	orgId := adminUserInfo.CurrentOrgId
4662
+	list, _ := service.GetPatientDialysisRecordList(id, startime.Unix(), endtime.Unix(), orgId)
4663
+	c.ServeSuccessJSON(map[string]interface{}{
4664
+		"list": list,
4665
+	})
4657 4666
 }

+ 6 - 0
service/mobile_dialysis_service.go Ver arquivo

@@ -1949,3 +1949,9 @@ func BatchDeleteMonitor(ids []int64) (err error) {
1949 1949
 
1950 1950
 	return
1951 1951
 }
1952
+
1953
+func GetPatientDialysisRecordList(patientid int64, startime int64, endtime int64, orgid int64) (order []*models.XtDialysisOrder, err error) {
1954
+
1955
+	err = XTReadDB().Model(&order).Where("patient_id = ? and dialysis_date>=? and dialysis_date<=? and user_org_id = ? and status = 1", patientid, startime, endtime, orgid).Find(&order).Error
1956
+	return order, err
1957
+}