2
3
Quellcode durchsuchen

bug
Signed-off-by: lijunqing <lijunqing@dashoo.cn>

lijunqing vor 6 Jahren
Ursprung
Commit
c5e5a8c269

+ 4 - 3
src/dashoo.cn/backend/api/business/oilsupplier/selectbusiness/selectservice.go

@@ -20,7 +20,7 @@ func GetSelectService(xormEngine *xorm.Engine) *SelectService {
 	return s
 }
 
-func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilSupplierCert2FileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having string) (total int64) {
+func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilSupplierCertSubName,OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having string) (total int64) {
 
 	//获取总记录数
 	/*sqlCount := `select count(*) from (`
@@ -42,11 +42,12 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	sql += `a.DepositBank,a.HseTraining,a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street, `
 	sql += `a.LinkAddress,a.LinkProvince,a.LinkCity,a.LinkStreet,a.BusinessScope, `
 	sql += `b.InStyle,`
-	sql += `group_concat(distinct d.Name) CerSubName,group_concat(distinct d.NeedFileType) NeedFileType `
+	sql += `group_concat(distinct d.Name) CerSubName,group_concat(distinct e.NeedFileType) NeedFileType `
 	sql += `from ` + supplierTableName + ` a `
 	sql += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
 	sql += `left join ` + OilInfoChangeName + ` c  on c.SupplierId = a.Id `
-	sql += `left join ` + OilSupplierCert2FileName + ` d  on d.SupplierCertId = b.Id `
+	sql += `left join ` + OilSupplierCertSubName + ` d  on d.SupplierCertId = b.Id `
+	sql += `left join ` + OilSupplierFileName + ` e  on e.SupplierId = a.Id `
 	sql += `where ` + where
 
 	sql += ` group by a.Id,b.Id ` + having

+ 1 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/select.go

@@ -196,7 +196,7 @@ func (this *SelectController) GetTList() {
 	svc := selectbusiness.GetSelectService(utils.DBE)
 	var list []supplier.OilSupplierSelect
 
-	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilSupplierCert2FileName , page.CurrentPage, page.Size, orderby, asc, &list, where,having)
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilSupplierCertSubName,OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having)
 
 	var datainfo DataInfo
 	datainfo.Items = list