Browse Source

Objects auto-load fix

Vova Tkach 5 years ago
parent
commit
a4f1747709

+ 1 - 1
engine/fetdata/blog_category.go

@@ -31,7 +31,7 @@ func (this *BlogCategory) User() *User {
 	if this.user != nil {
 		return this.user
 	}
-	this.user = &User{wrap: this.wrap}
+	this.user = (&User{wrap: this.wrap}).load()
 	this.user.loadById(this.object.A_user)
 	return this.user
 }

+ 1 - 1
engine/fetdata/blog_post.go

@@ -33,7 +33,7 @@ func (this *BlogPost) User() *User {
 	if this.user != nil {
 		return this.user
 	}
-	this.user = &User{wrap: this.wrap}
+	this.user = (&User{wrap: this.wrap}).load()
 	this.user.loadById(this.object.A_user)
 	return this.user
 }

+ 1 - 1
engine/fetdata/shop_category.go

@@ -103,7 +103,7 @@ func (this *ShopCategory) User() *User {
 	if this.user != nil {
 		return this.user
 	}
-	this.user = &User{wrap: this.wrap}
+	this.user = (&User{wrap: this.wrap}).load()
 	this.user.loadById(this.object.A_user)
 	return this.user
 }

+ 3 - 3
engine/fetdata/shop_product.go

@@ -113,7 +113,7 @@ func (this *ShopProduct) User() *User {
 	if this.user != nil {
 		return this.user
 	}
-	this.user = &User{wrap: this.wrap}
+	this.user = (&User{wrap: this.wrap}).load()
 	this.user.loadById(this.object.A_user)
 	return this.user
 }
@@ -125,7 +125,7 @@ func (this *ShopProduct) Currency() *Currency {
 	if this.currency != nil {
 		return this.currency
 	}
-	this.currency = &Currency{wrap: this.wrap}
+	this.currency = (&Currency{wrap: this.wrap}).load()
 	this.currency.loadById(this.object.A_currency)
 	return this.currency
 }
@@ -179,7 +179,7 @@ func (this *ShopProduct) Category() *ShopCategory {
 	if this.category != nil {
 		return this.category
 	}
-	this.category = &ShopCategory{wrap: this.wrap}
+	this.category = (&ShopCategory{wrap: this.wrap}).load()
 	this.category.loadById(this.object.A_category)
 	return this.category
 }