陈少旭 9 ヶ月 前
コミット
2da36c61e9
共有2 個のファイルを変更した15 個の追加0 個の削除を含む
  1. 2 0
      controllers/statistics_api_controller.go
  2. 13 0
      service/statistis_qc_service.go

+ 2 - 0
controllers/statistics_api_controller.go ファイルの表示

@@ -1238,6 +1238,8 @@ func (c *StatisticsApiController) GetDialyzerDetail() {
1238 1238
 }
1239 1239
 func (c *StatisticsApiController) GetDialyzerConfig() {
1240 1240
 	dialyzers, _ := service.GetDialyzerSummary(c.GetAdminUserInfo().CurrentOrgId)
1241
+	Irrigation, _ := service.GetIrrigationSummary(c.GetAdminUserInfo().CurrentOrgId)
1242
+	dialyzers = append(dialyzers, Irrigation...)
1241 1243
 	c.ServeSuccessJSON(map[string]interface{}{
1242 1244
 		"dialyzers": dialyzers,
1243 1245
 	})

+ 13 - 0
service/statistis_qc_service.go ファイルの表示

@@ -581,6 +581,19 @@ func GetDialyzerSummary(org_id int64) ([]string, error) {
581 581
 	return Dialyzer, nil
582 582
 }
583 583
 
584
+func GetIrrigationSummary(org_id int64) ([]string, error) {
585
+	var Irrigation []string
586
+	err := XTReadDB().Model(&models.DialysisPrescription{}).
587
+		Select("dialysis_irrigation").
588
+		Where(" user_org_id = ? and status = 1", org_id).
589
+		Group("dialysis_irrigation").
590
+		Scan(&Irrigation).Error
591
+	if err != nil {
592
+		return nil, err
593
+	}
594
+	return Irrigation, nil
595
+}
596
+
584 597
 type DialyzerResult struct {
585 598
 	Dialyzer string
586 599
 	Count    int