|
@@ -497,6 +497,7 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
historyCond += ` AND new_company = 0 `
|
|
|
}
|
|
|
|
|
|
+ groupIds := make([]int, 0)
|
|
|
if req.GroupId > 0 {
|
|
|
|
|
|
groupCond := `parent_id = ?`
|
|
@@ -508,7 +509,6 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
resp.FailMsg("获取失败", "获取组别下级组列表失败, Err: "+e.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- groupIds := make([]int, 0)
|
|
|
groupIds = append(groupIds, req.GroupId)
|
|
|
for i := range groupList {
|
|
|
groupIds = append(groupIds, groupList[i].GroupId)
|
|
@@ -559,6 +559,11 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
amountCond := `a.id IN ? `
|
|
|
amountPars := make([]interface{}, 0)
|
|
|
amountPars = append(amountPars, summaryIds)
|
|
|
+ if len(groupIds) > 0 {
|
|
|
+ historyCond += ` AND AND IF ( a.invoice_id = 0, d.seller_group_id, b.seller_group_id ) IN (?) `
|
|
|
+ historyPars = append(historyPars, groupIds)
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -639,6 +644,10 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
amountCond := `a.id IN ? `
|
|
|
amountPars := make([]interface{}, 0)
|
|
|
amountPars = append(amountPars, summaryIds)
|
|
|
+ if len(groupIds) > 0 {
|
|
|
+ historyCond += ` AND AND IF ( a.invoice_id = 0, d.seller_group_id, b.seller_group_id ) IN (?) `
|
|
|
+ historyPars = append(historyPars, groupIds)
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -733,6 +742,10 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
amountCond := `a.id IN ? `
|
|
|
amountPars := make([]interface{}, 0)
|
|
|
amountPars = append(amountPars, summaryIds)
|
|
|
+ if len(groupIds) > 0 {
|
|
|
+ historyCond += ` AND AND IF ( a.invoice_id = 0, d.seller_group_id, b.seller_group_id ) IN (?) `
|
|
|
+ historyPars = append(historyPars, groupIds)
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|