Browse Source

Rename vars

Vova Tkach 6 years ago
parent
commit
b92f3d0223
1 changed files with 5 additions and 5 deletions
  1. 5 5
      modules/module_blog.go

+ 5 - 5
modules/module_blog.go

@@ -12,7 +12,7 @@ import (
 	"golang-fave/utils"
 	"golang-fave/utils"
 )
 )
 
 
-func (this *Modules) blog_GetCategorySelectOptions(wrap *wrapper.Wrapper, id int) string {
+func (this *Modules) blog_GetCategorySelectOptions(wrap *wrapper.Wrapper, parentId int) string {
 	result := ``
 	result := ``
 	rows, err := wrap.DB.Query(
 	rows, err := wrap.DB.Query(
 		`SELECT
 		`SELECT
@@ -38,7 +38,7 @@ func (this *Modules) blog_GetCategorySelectOptions(wrap *wrapper.Wrapper, id int
 		for i := range values {
 		for i := range values {
 			scan[i] = &values[i]
 			scan[i] = &values[i]
 		}
 		}
-		idStr := utils.IntToStr(id)
+		idStr := utils.IntToStr(parentId)
 		for rows.Next() {
 		for rows.Next() {
 			err = rows.Scan(scan...)
 			err = rows.Scan(scan...)
 			if err == nil {
 			if err == nil {
@@ -55,7 +55,7 @@ func (this *Modules) blog_GetCategorySelectOptions(wrap *wrapper.Wrapper, id int
 }
 }
 
 
 func (this *Modules) blog_GetCategoryParentId(wrap *wrapper.Wrapper, id int) int {
 func (this *Modules) blog_GetCategoryParentId(wrap *wrapper.Wrapper, id int) int {
-	var result int
+	var parentId int
 	_ = wrap.DB.QueryRow(`
 	_ = wrap.DB.QueryRow(`
 		SELECT
 		SELECT
 			parent.id
 			parent.id
@@ -72,9 +72,9 @@ func (this *Modules) blog_GetCategoryParentId(wrap *wrapper.Wrapper, id int) int
 		id,
 		id,
 		id,
 		id,
 	).Scan(
 	).Scan(
-		&result,
+		&parentId,
 	)
 	)
-	return result
+	return parentId
 }
 }
 
 
 func (this *Modules) RegisterModule_Blog() *Module {
 func (this *Modules) RegisterModule_Blog() *Module {