Parcourir la source

Merge branch 'crm_17.1_rai' of http://8.136.199.33:3000/hongze/fms_api into debug

zhangchuanxing il y a 1 jour
Parent
commit
18cef4635a
2 fichiers modifiés avec 11 ajouts et 2 suppressions
  1. 7 0
      controller/census/income_list.go
  2. 4 2
      models/fms/invoice_payment_summary.go

+ 7 - 0
controller/census/income_list.go

@@ -1099,6 +1099,7 @@ func (this *InvoicePaymentController) IncomeList(c *gin.Context) {
 		resp.FailData("参数解析失败", err.Translate(global.Trans), c)
 		return
 	}
+
 	//收入统计
 	var incomeList base.BaseData
 	ch := make(chan base.BaseData, 1)
@@ -1246,6 +1247,9 @@ func getPaymentIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseDat
 
 			respItems := make([]*fms.IncomeSummaryRespItem, 0)
 			for _, v := range results {
+				if v.WxUserId > 0 {
+					v.CompanyName = v.WxUserName + "(" + v.CompanyName + ")"
+				}
 				respItem := &fms.IncomeSummaryRespItem{
 					CompanyName:   v.CompanyName,
 					ContractType:  v.ContractType,
@@ -1675,6 +1679,9 @@ func getCensusIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseData
 
 			respItems := make([]*fms.IncomeSummaryRespItem, 0)
 			for _, v := range resultList {
+				if v.WxUserId > 0 {
+					v.CompanyName = v.WxUserName + "(" + v.CompanyName + ")"
+				}
 				respItem := &fms.IncomeSummaryRespItem{
 					CompanyName:   v.CompanyName,
 					ContractType:  v.ContractType,

+ 4 - 2
models/fms/invoice_payment_summary.go

@@ -205,6 +205,8 @@ type IncomeSummaryItem struct {
 	SellerGroupName int       `json:"seller_group_name" description:"销售分组名称"`
 	CurrencyUnit    string    `json:"currency_unit" description:"货币单位"`
 	ServicesName    string    `json:"services" description:"套餐名称"`
+	WxUserId        int       `json:"wx_user_id" description:"用户id,针对某份合同仅对单个用户使用的时候的场景"`
+	WxUserName      string    `json:"wx_user_name"  description:"用户姓名,针对某份合同仅对单个用户使用的时候的场景"`
 }
 
 // GetContractSummaryIncomeAmount 获取汇总金额合计信息
@@ -214,7 +216,7 @@ func GetContractSummaryIncomeAmount(condition string, pars []interface{}) (resul
 			"IF(a.invoice_id=0,d.origin_amount, b.origin_amount) AS origin_amount,"+
 			"IF(a.invoice_id=0,d.invoice_time, b.invoice_time) AS invoice_date,"+
 			"IF(a.invoice_id=0,d.currency_unit, b.currency_unit) AS currency_unit,"+
-			" c.contract_type,c.company_name,"+
+			" c.contract_type,c.company_name,c.wx_user_id,c.wx_user_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,"+
@@ -437,7 +439,7 @@ func GetContractSummaryPaymentIncomeAmountPage(condition string, pars []interfac
 
 	query = global.DEFAULT_MYSQL.Table("invoice_payment_summary AS a").
 		Select("d.origin_amount, d.amount AS amount,d.currency_unit, d.invoice_time AS invoice_date,"+
-			" c.contract_type,c.company_name,d.seller_name,"+
+			" c.contract_type,c.company_name,c.wx_user_id,c.wx_user_name,d.seller_name,"+
 			" d.seller_id AS final_seller_id, GROUP_CONCAT(s.title) AS services_name ").
 		Joins("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").