소스 검색

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 1 개월 전
부모
커밋
a5df9aa3e3
3개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 2 1
      controllers/statistics_api_controller.go
  2. 1 1
      service/export_data_service.go
  3. 3 4
      service/statistis_qc_service.go

+ 2 - 1
controllers/statistics_api_controller.go 파일 보기

@@ -93,6 +93,7 @@ func (c *StatisticsApiController) GetPatientWeightDetail() {
93 93
 	after_type, _ := c.GetInt64("after_type")
94 94
 	page, _ := c.GetInt64("page")
95 95
 	limit, _ := c.GetInt64("limit")
96
+	keyword := c.GetString("keyword")
96 97
 
97 98
 	timeLayout := "2006-01-02"
98 99
 	loc, _ := time.LoadLocation("Local")
@@ -116,7 +117,7 @@ func (c *StatisticsApiController) GetPatientWeightDetail() {
116 117
 		}
117 118
 		endTime = theTime.Unix()
118 119
 	}
119
-	data, total, _ := service.GetNewDialysisWeightDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit)
120
+	data, total, _ := service.GetNewDialysisWeightDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit, keyword)
120 121
 	fmt.Println(data)
121 122
 	c.ServeSuccessJSON(map[string]interface{}{
122 123
 		"list":  data,

+ 1 - 1
service/export_data_service.go 파일 보기

@@ -126,7 +126,7 @@ func GetHisOrderDetailFor390(start_time string, end_time string, org_id int64) (
126 126
 	return
127 127
 }
128 128
 func GetHisOrderByTime(patient_id int64, start_time string, end_time string) (order []models.HisOrder, err error) {
129
-	err = readDb.Model(&models.HisOrder{}).Where("patient_id = ? AND status = 1 and order_status = 2 and setl_time >= ? and setl_time <= ?", patient_id, start_time+" 00:00:00", end_time+" 23:59:00").Find(&order).Error
129
+	err = readDb.Model(&models.HisOrder{}).Where("patient_id = ? AND status = 1 and order_status = 2 and  FROM_UNIXTIME(settle_accounts_date)  >= ? and FROM_UNIXTIME(settle_accounts_date) <= ?", patient_id, start_time+" 00:00:00", end_time+" 23:59:00").Find(&order).Error
130 130
 	return
131 131
 }
132 132
 

+ 3 - 4
service/statistis_qc_service.go 파일 보기

@@ -2090,12 +2090,11 @@ func GetNewDialysisWeightDetailTableTen(
2090 2090
 	user_org_id int64,
2091 2091
 	start_time int64,
2092 2092
 	end_time int64,
2093
-	addType, dryType, afterType, page, limit int64,
2094
-) ([]DialysisDataTwo, int64, error) {
2093
+	addType, dryType, afterType, page, limit int64, keyword string) ([]DialysisDataTwo, int64, error) {
2095 2094
 	offset := (page - 1) * limit
2096 2095
 	//var dialysisData []DialysisDataTwo
2097 2096
 	var total int64
2098
-
2097
+	keyword = "%" + keyword + "%"
2099 2098
 	// 构建基本查询
2100 2099
 	query := readDb.Table("xt_assessment_before_dislysis b").
2101 2100
 		Select(`
@@ -2159,7 +2158,7 @@ func GetNewDialysisWeightDetailTableTen(
2159 2158
                ELSE '其他'
2160 2159
            END AS weight_status
2161 2160
        `).
2162
-		Joins("left JOIN xt_patients p ON p.id = b.patient_id").
2161
+		Joins("JOIN xt_patients p ON p.id = b.patient_id and p.name like ?", keyword).
2163 2162
 		Joins("left JOIN xt_assessment_after_dislysis a ON p.id = a.patient_id AND b.assessment_date = a.assessment_date AND a.status = 1").
2164 2163
 		Where("b.user_org_id = ?", user_org_id).
2165 2164
 		Where("b.assessment_date >= ?", start_time).