forked from free-lancers/electricity_bill_calc_service
		
	fix(report):修正精简组装报表查询语句。
This commit is contained in:
		| @@ -602,19 +602,12 @@ func (_ReportService) AssembleReportPublicity(reportId string) (*model.Publicity | |||||||
| 	var report = new(model.Report) | 	var report = new(model.Report) | ||||||
| 	err := global.DB.NewSelect().Model(report). | 	err := global.DB.NewSelect().Model(report). | ||||||
| 		Relation("Summary").Relation("WillDilutedFees").Relation("EndUsers"). | 		Relation("Summary").Relation("WillDilutedFees").Relation("EndUsers"). | ||||||
| 		Relation("Park"). | 		Relation("Park").Relation("Park.Enterprise"). | ||||||
| 		Where("r.id = ?", reportId). | 		Where("r.id = ?", reportId). | ||||||
| 		Scan(ctx) | 		Scan(ctx) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, exceptions.NewNotFoundErrorFromError("未找到指定的公示报表", err) | 		return nil, exceptions.NewNotFoundErrorFromError("未找到指定的公示报表", err) | ||||||
| 	} | 	} | ||||||
| 	var enterprise = new(model.UserDetail) |  | ||||||
| 	err = global.DB.NewSelect().Model(enterprise). |  | ||||||
| 		Where("id = ?", report.Park.UserId). |  | ||||||
| 		Scan(ctx) |  | ||||||
| 	if err != nil { |  | ||||||
| 		return nil, exceptions.NewNotFoundErrorFromError("未找到指定公示报表对应的用户信息", err) |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| 	// 组合数据 | 	// 组合数据 | ||||||
| 	paidPart := model.PaidPart{ | 	paidPart := model.PaidPart{ | ||||||
| @@ -729,7 +722,7 @@ func (_ReportService) AssembleReportPublicity(reportId string) (*model.Publicity | |||||||
| 	publicity := &model.Publicity{ | 	publicity := &model.Publicity{ | ||||||
| 		Report:                   *report, | 		Report:                   *report, | ||||||
| 		Park:                     *report.Park, | 		Park:                     *report.Park, | ||||||
| 		User:                     *enterprise, | 		User:                     *report.Park.Enterprise, | ||||||
| 		Paid:                     paidPart, | 		Paid:                     paidPart, | ||||||
| 		EndUser:                  endUserSummary, | 		EndUser:                  endUserSummary, | ||||||
| 		Loss:                     lossPart, | 		Loss:                     lossPart, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user