2
3
dubch 5 лет назад
Родитель
Сommit
94f4e8346d

+ 3 - 3
src/dashoo.cn/backend/api/business/oilsupplier/infochange/infochangeService.go

@@ -211,13 +211,13 @@ func (s *InfoChangeService) GetUsedNameWithOrderBytbl(SupplierName, infoChangeNa
 	//获取总记录数
 	sqlCount := `select count(*) from ` + SupplierName + ` a `
 	sqlCount += ` left join ` + infoChangeName + ` b  on b.SupplierId = a.Id `
-	sqlCount += ` where ` + where
+	sqlCount += ` where b.SelectItem = 'SupplierName'` + where
 
 	var sql string
-	sql = `select a.SupplierName, b.OldSupplierName`
+	sql = `select a.SupplierName, b.ChangeInfo as OldSupplierName`
 	sql += ` from ` + SupplierName + ` a `
 	sql += ` left join ` + infoChangeName + ` b on b.SupplierId = a.Id `
-	sql += ` where ` + where
+	sql += ` where b.SelectItem = 'SupplierName' and` + where
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -425,7 +425,7 @@ func (this *InfoChangeController) GetSuppList() {
 func (this *InfoChangeController) GetAllEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
-	where := " 1=1 and b.OldSupplierName is not null"
+	where := " 1=1"
 	orderby := "a.Id"
 	asc := false
 	Order := this.GetString("Order")
@@ -465,7 +465,7 @@ func (this *InfoChangeController) GetAllEntityList() {
 
 	svc := infochange.GetInfoChangeService(utils.DBE)
 	var list []infochange.OilUsedName
-	total := svc.GetUsedNameWithOrderBytbl(OilSupplierName, OilInfoChangeName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	total := svc.GetUsedNameWithOrderBytbl(OilSupplierName, OilInfoChangeItemName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total