浏览代码

提交代码

陈少旭 1年前
父节点
当前提交
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
 }
1238
 }
1239
 func (c *StatisticsApiController) GetDialyzerConfig() {
1239
 func (c *StatisticsApiController) GetDialyzerConfig() {
1240
 	dialyzers, _ := service.GetDialyzerSummary(c.GetAdminUserInfo().CurrentOrgId)
1240
 	dialyzers, _ := service.GetDialyzerSummary(c.GetAdminUserInfo().CurrentOrgId)
1241
+	Irrigation, _ := service.GetIrrigationSummary(c.GetAdminUserInfo().CurrentOrgId)
1242
+	dialyzers = append(dialyzers, Irrigation...)
1241
 	c.ServeSuccessJSON(map[string]interface{}{
1243
 	c.ServeSuccessJSON(map[string]interface{}{
1242
 		"dialyzers": dialyzers,
1244
 		"dialyzers": dialyzers,
1243
 	})
1245
 	})

+ 13 - 0
service/statistis_qc_service.go 查看文件

581
 	return Dialyzer, nil
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
 type DialyzerResult struct {
597
 type DialyzerResult struct {
585
 	Dialyzer string
598
 	Dialyzer string
586
 	Count    int
599
 	Count    int