From d49a27c95126a0115a22cd79a275fd0496185f49 Mon Sep 17 00:00:00 2001 From: yarik Date: Fri, 7 Oct 2016 16:47:00 +0300 Subject: [PATCH] Export fix --- common/modules/product/models/Export.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/modules/product/models/Export.php b/common/modules/product/models/Export.php index 3865054..009a053 100644 --- a/common/modules/product/models/Export.php +++ b/common/modules/product/models/Export.php @@ -17,6 +17,8 @@ public function process($filename = NULL, $from = 0) { + + $limit = 100; if(empty( $filename )) { $filename = 'products_' . date('d_m_Y_H_i') . '.csv'; $handle = fopen(\Yii::getAlias('@storage/sync/') . $filename, "w"); @@ -26,13 +28,13 @@ $products = Product::find() - ->joinWith([ + ->with( 'variantsWithFilters', 'brand', - 'categories', - ]) + 'categories' + ) ->with('filters') - ->limit(1000) + ->limit($limit) ->offset($from) ->all(); $filesize = Product::find() @@ -79,7 +81,7 @@ fclose($handle); - $from += 1000; + $from += $limit; $end = false; if($from > $filesize) { $end = true; -- libgit2 0.21.4