|
|
@@ -95,7 +95,7 @@ func (s *OilContractService) GetMyPagingEntitiesWithOrderByIsReview(oilContractN
|
|
|
var resultsSlice []map[string][]byte
|
|
|
|
|
|
//获取总记录数
|
|
|
- sqlCount := `select count(a.Id) from ` + oilContractName + ` a `
|
|
|
+ sqlCount := `select count(DISTINCT a.Id) from ` + oilContractName + ` a `
|
|
|
sqlCount += ` left join ` + oilContractReviewName + " b on b.ContractId = a.Id"
|
|
|
sqlCount += ` where ` + where
|
|
|
if isReview == "1" {
|
|
|
@@ -113,7 +113,7 @@ func (s *OilContractService) GetMyPagingEntitiesWithOrderByIsReview(oilContractN
|
|
|
}
|
|
|
|
|
|
var sql string
|
|
|
- sql = `select SQL_CALC_FOUND_ROWS a.*, count(b.Id)`
|
|
|
+ sql = `select a.*, count(b.Id)`
|
|
|
sql += ` from ` + oilContractName + ` a `
|
|
|
sql += ` left join ` + oilContractReviewName + " b on b.ContractId = a.Id"
|
|
|
sql += ` where ` + where
|