Commit b2f4bd8388c32849e11c416c27a2cabe80073bfe
1 parent
db3f8716
add variantSku
Showing
1 changed file
with
2 additions
and
3 deletions
Show diff stats
console/SiteMapController.php
@@ -35,8 +35,7 @@ | @@ -35,8 +35,7 @@ | ||
35 | { | 35 | { |
36 | return ProductVariant::find() | 36 | return ProductVariant::find() |
37 | ->with('lang') | 37 | ->with('lang') |
38 | - ->with('product.lang') | ||
39 | - ->batch(10000); | 38 | + ->with('product.lang'); |
40 | 39 | ||
41 | } | 40 | } |
42 | 41 | ||
@@ -160,7 +159,7 @@ | @@ -160,7 +159,7 @@ | ||
160 | $this->createRow($url, 0.8); | 159 | $this->createRow($url, 0.8); |
161 | } | 160 | } |
162 | 161 | ||
163 | - foreach ($this->getVariants() as $rows) { | 162 | + foreach ($this->getVariants()->batch(1000) as $rows) { |
164 | foreach ($rows as $row) { | 163 | foreach ($rows as $row) { |
165 | if(!preg_match("@^[a-zA-Z\d]+$@i", $row->sku)) { | 164 | if(!preg_match("@^[a-zA-Z\d]+$@i", $row->sku)) { |
166 | continue; | 165 | continue; |