|
@@ -512,8 +512,6 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
// historyPars = append(historyPars, groupIds)
|
|
|
//}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
// 获取销售分组信息
|
|
|
sellerList, e := crmService.GetSellerDepartmentListWithEnable()
|
|
|
if e != nil {
|
|
@@ -521,8 +519,8 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- ficcSellerIds := make([]string,0)
|
|
|
- raiSellerIds := make([]string,0)
|
|
|
+ ficcSellerIds := make([]string, 0)
|
|
|
+ raiSellerIds := make([]string, 0)
|
|
|
sellerMap := make(map[int]*crm.SellerAdminWithGroupTeam)
|
|
|
for i := range sellerList {
|
|
|
sellerMap[sellerList[i].SellerId] = sellerList[i]
|
|
@@ -532,7 +530,7 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
raiSellerIds = append(raiSellerIds, strconv.Itoa(sellerList[i].SellerId))
|
|
|
}
|
|
|
}
|
|
|
- sellerIds := make([]string,0)
|
|
|
+ sellerIds := make([]string, 0)
|
|
|
|
|
|
if req.SellerType == 1 {
|
|
|
//cond += ` AND b.contract_type = 1 `
|
|
@@ -755,11 +753,11 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
//sellerIds := strings.Split(req.SellerIds, ",")
|
|
|
amountCond += ` AND (( b.seller_id IN ? AND a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
|
|
|
amountCond += `OR ( d.seller_id IN ? AND a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?)) `
|
|
|
- amountPars = append(amountPars, sellerIds, st, ed, sellerIds, st, ed)
|
|
|
+ amountPars = append(amountPars, sellerIds, historyTime, ed, sellerIds, historyTime, ed)
|
|
|
} else {
|
|
|
amountCond += ` AND ((a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
|
|
|
amountCond += `OR (a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?))`
|
|
|
- amountPars = append(amountPars, st, ed, st, ed)
|
|
|
+ amountPars = append(amountPars, historyTime, ed, historyTime, ed)
|
|
|
}
|
|
|
results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
|
|
|
if e != nil {
|
|
@@ -790,7 +788,7 @@ func (this *SellerController) InvoiceListV2(c *gin.Context) {
|
|
|
}
|
|
|
if st != "" && ed != "" {
|
|
|
historyCond += ` AND (invoice_time BETWEEN ? AND ? )`
|
|
|
- historyPars = append(historyPars, st, ed)
|
|
|
+ historyPars = append(historyPars, st, historyTime)
|
|
|
}
|
|
|
results, e := fms.GetIncomeHistory(historyCond, historyPars)
|
|
|
if e != nil {
|