Browse Source

git commit -a -m '前后:供方信息查询企业资质'

dubch 5 năm trước cách đây
mục cha
commit
2420f79ce9

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

@@ -21,7 +21,7 @@ func GetSelectService(xormEngine *xorm.Engine) *SelectService {
 }
 
 func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
-	OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having, CerSubName string, Ids string) (total int64) {
+	OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having, CerSubName string, Ids string, NeedFileType string) (total int64) {
 
 	//获取总记录数
 	/*sqlCount := `select count(*) from (`
@@ -42,14 +42,19 @@ func (s *SelectService) GetMyPagingEntitiesWithOrderBytbl(supplierTableName, sup
 	sql += `a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.EffectEndTime,b.InFlag,a.ContactName,a.CommercialNo, `
 	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, b.Id CertId, f.FullName, b.RecUnitName as CheckUnitName, b.Remark, `
-	sql += `group_concat(distinct e.NeedFileType) NeedFileType `
+	sql += `b.InStyle, b.Id CertId, f.FullName, b.RecUnitName as CheckUnitName, b.Remark `
+	if NeedFileType != "" {
+		sql += `,group_concat(distinct e.NeedFileType) NeedFileType `
+	}
 	sql += `from ` + supplierTableName + ` a `
 	sql += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
 	sql += `left join  Base_Organize f on f.Id = b.ThirdAudit `
 	// sql += `left join  OilCorporateInfo g on g.CommercialNo = a.CommercialNo `
 	// sql += `left join ` + OilInfoChangeName + ` c  on c.SupplierId = a.Id `
-	sql += `left join ` + OilSupplierFileName + ` e  on e.SupplierId = a.Id `
+	if NeedFileType != "" {
+		sql += `left join ` + OilSupplierFileName + ` e  on e.SupplierId = a.Id `
+	}
+
 	sql += `where ` + where
 
 	if CerSubName != "" && Ids != "" {

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

@@ -259,7 +259,7 @@ func (this *SelectController) GetTList() {
 	var list []supplier.OilSupplierSelect
 
 	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
-		OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where, having, model.CerSubName, Ids.Ids)
+		OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where, having, model.CerSubName, Ids.Ids, model.NeedFileType)
 
 	var datainfo DataInfo
 	datainfo.Items = list