|
@@ -721,7 +721,7 @@ type NotPaymentCensusInfo struct {
|
|
|
}
|
|
|
|
|
|
// GetCensusSellerGroupInvoicePageListV2 获取销售组开票统计列表-分页
|
|
|
-func GetCensusSellerGroupInvoicePageListV2(page base.IPage,groupStr, condition string, pars []interface{}, amountSum float64) (results []*CensusSellerGroupInvoiceItem, err error) {
|
|
|
+func GetCensusSellerGroupInvoicePageListV2(page base.IPage,groupStr, condition string, pars []interface{}, amountSum float64) (count int, results []*CensusSellerGroupInvoiceItem, err error) {
|
|
|
sql := `
|
|
|
SELECT
|
|
|
seller_group_id AS group_id,
|
|
@@ -736,6 +736,18 @@ func GetCensusSellerGroupInvoicePageListV2(page base.IPage,groupStr, condition s
|
|
|
seller_group_id ORDER BY %s LIMIT %d,%d
|
|
|
`
|
|
|
|
|
|
+ sqlCount := ` select count(1) as count from (SELECT *
|
|
|
+ FROM
|
|
|
+ contract_invoice
|
|
|
+ WHERE
|
|
|
+ %s
|
|
|
+ AND seller_group_id IN (`+groupStr+`)
|
|
|
+ GROUP BY
|
|
|
+ seller_group_id )as a
|
|
|
+ `
|
|
|
+ sqlCount = fmt.Sprintf(sqlCount, condition)
|
|
|
+ err = global.DEFAULT_MYSQL.Raw(sqlCount, pars...).Find(&count).Error
|
|
|
+
|
|
|
sql = fmt.Sprintf(sql, amountSum, condition, page.GetOrderItemsString(), page.Offset(), page.GetPageSize())
|
|
|
err = global.DEFAULT_MYSQL.Raw(sql, pars...).Scan(&results).Error
|
|
|
return
|