xiziwen 3 months ago
parent
commit
d54caea70a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      models/fms/invoice_payment_summary.go

+ 3 - 1
models/fms/invoice_payment_summary.go

@@ -214,10 +214,12 @@ func GetContractSummaryIncomeAmount(condition string, pars []interface{}) (resul
 			" c.contract_type,c.company_name,"+
 			"IF(a.invoice_id=0,d.seller_name, b.seller_name) AS seller_name,"+
 			"IF(a.invoice_id=0,d.seller_id, b.seller_id) AS final_seller_id,"+
-			"IF(a.invoice_id=0,d.seller_group_id, b.seller_group_id) AS seller_group_id").
+			"IF(a.invoice_id=0,d.seller_group_id, b.seller_group_id) AS seller_group_id,"+
+			"GROUP_CONCAT(s.title) AS services_name ").
 		Joins("LEFT JOIN contract_invoice AS b ON a.invoice_id = b.contract_invoice_id AND b.is_deleted = 0 ").
 		Joins("LEFT JOIN contract_invoice AS d ON a.payment_id = d.contract_invoice_id AND d.is_deleted = 0").
 		Joins("JOIN contract_register AS c ON a.register_id = c.contract_register_id AND c.is_deleted = 0").
+		Joins("LEFT JOIN contract_service AS s ON s.contract_register_id = c.contract_register_id").
 		Where(condition, pars...).Group("id").Order("invoice_date ")
 	//nq := global.DEFAULT_MYSQL.Table("(?) AS e", query).
 	//	Select(" IFNULL( SUM( e.amount ), 0 ) ")